Branch Coverage

blib/lib/OpenGuides.pm
Criterion Covered Total %
branch 298 430 69.3


line true false branch
53 98 14 if ($geo_handler == 1) { }
4 10 elsif ($geo_handler == 2) { }
70 1 111 if ($self->config->ping_services)
75 0 1 if ($@) { }
83 2 1 if ($well_known{$s}) { }
211 1 102 defined $args{'redirect'} ? :
218 1 102 if ($host_checker)
225 1 102 if ($is_blacklisted)
235 1 0 if $return_output
242 10 92 if ($id =~ /^(Category|Locale) (.*)$/)
257 0 102 if $version and $version == $current_version
259 1 101 if $version
265 85 17 if ($node_data{'content'})
277 0 102 if ($args{'format'} and $args{'format'} eq 'raw')
278 0 0 unless $noheaders
290 85 17 $node_exists ? :
309 1 101 if $args{'version'}
311 89 13 if ($config->show_gmap_in_node_display and $self->get_cookie('display_google_maps'))
318 3 99 if ($redirect)
320 1 2 if ($do_redirect == 0) { }
2 0 elsif ($wiki->node_exists($redirect) and $redirect ne $id and $redirect ne $oldid) { }
322 0 1 if $args{'return_tt_vars'}
329 1 0 if $return_output
333 2 0 if ($return_output)
334 2 0 if ($intercept_redirect) { }
349 98 1 unless $version
351 2 97 if ($id eq 'RecentChanges') { }
16 81 elsif ($id eq $self->config->home_name) { }
354 15 1 if ($self->config->recent_changes_on_home_page)
378 1 15 if $args{'return_tt_vars'}
386 15 0 if $return_output
389 8 73 if $args{'return_tt_vars'}
397 73 0 if $return_output
430 3 4 if ($args{'category'})
437 3 4 if ($args{'locale'})
445 2 5 if ($args{'category'} and $args{'locale'}) { }
1 4 elsif ($args{'category'}) { }
1 3 elsif ($args{'locale'}) { }
452 1 2 if $count{$node} > 1
465 2 5 if ($omit_cats or $omit_locs)
467 1 1 if ($omit_cats)
477 1 1 if ($omit_locs)
492 6 1 if ($node) { }
506 7 0 if $args{'return_output'}
542 6 0 $self->get_cookie('default_edit_type') eq 'normal' ? :
566 1 5 if $args{'content'}
567 0 6 if $args{'checksum'}
568 1 5 if (defined $args{'vars'})
574 1 5 if (defined $args{'metadata'})
586 6 0 if $return_output
625 1 0 if ($wiki->verify_checksum($node, $checksum)) { }
643 1 0 if $args{'return_output'}
674 12 2 unless ($from =~ /^$url_base/)
684 2 12 if $args{'return_tt_vars'}
693 12 0 if $args{'return_output'}
718 6 30 if ($since) { }
723 3 3 unless $minor_edits
727 5 1 if (scalar @rc)
736 64 56 unless $minor_edits
742 7 43 if $seen{$$node{'name'}}
746 34 86 if (scalar @filtered)
758 9 27 if (not $since and $self->get_cookie('track_recent_changes_views'))
764 8 28 if $args{'return_tt_vars'}
766 28 0 if $return_output
782 67 59 if ($criteria{'metadata_was'})
786 5 33 if $seen{$$node{'name'}}
850 0 4 if $args{'return_tt_vars'}
856 4 0 if $args{'return_output'}
908 0 0 if $args{'return_tt_vars'}
916 0 0 if $args{'return_output'}
993 2 33 if ($args{'type'} and $args{'value'}) { }
994 0 2 if ($args{'type'} eq 'fuzzy_title_match') { }
1011 1 32 if (not $cat || $loc) { }
1015 17 15 if ($cat)
1031 23 9 if ($loc)
1047 9 23 if ($cat and not $loc) { }
15 8 elsif ($loc and not $cat) { }
1056 8 12 if $count{$node} > 1
1073 17 23 if ($$criterion{'type'} eq 'category') { }
23 0 elsif ($$criterion{'type'} eq 'locale') { }
1098 62 0 if ($node)
1107 0 62 if $@
1111 48 14 if ($use_leaflet)
1112 19 0 if (defined $wgs84_lat and $wgs84_lat =~ /^[-.\d]+$/ and defined $wgs84_long and $wgs84_long =~ /^[-.\d]+$/)
1127 23 10 if ($args{'format'}) { }
1128 2 21 if ($args{'format'} eq 'rdf') { }
1 20 elsif ($args{'format'} eq 'json') { }
0 20 elsif ($args{'format'} eq 'plain') { }
18 2 elsif ($args{'format'} eq 'map') { }
2 0 elsif ($args{'format'} eq 'rss' or $args{'format'} eq 'atom') { }
1139 17 1 if ($use_leaflet) { }
1140 9 8 if ($nodes_on_map) { }
1173 2 0 if ($args{'cat'}) { }
1192 2 0 if $args{'return_output'}
1200 7 24 if $args{'return_tt_vars'}
1208 24 0 if ($args{'return_output'} and not $args{'intercept_redirect'})
1213 24 0 if $args{'return_output'}
1220 2 0 if ($args{'return_output'} or $args{'return_tt_vars'}) { }
1221 2 0 if ($args{'intercept_redirect'}) { }
1226 0 0 if ($type eq 'category') { }
0 0 elsif ($type eq 'locale') { }
1261 0 0 if ($args{'type'} and $args{'type'} ne 'metadata_type') { }
1277 0 0 if $args{'return_tt_vars'}
1282 0 0 if ($args{'format'})
1283 0 0 if ($args{'format'} eq 'json')
1292 0 0 unless ($output)
1300 0 0 if $args{'return_output'}
1302 0 0 if ($content_type)
1338 4 0 if $node_data{'version'}
1357 0 4 if $args{'return_tt_vars'}
1363 4 0 if $return_output
1425 0 6 unless $feed_type
1428 0 6 unless $feed_listing
1430 6 0 $args{'return_output'} ? :
1440 2 4 if ($feed_listing eq 'recent_changes') { }
4 0 elsif ($feed_listing eq 'node_all_versions') { }
1443 2 0 $args{'ignore_minor_edits'} ? :
1450 2 0 if $username
1451 0 2 if $category
1452 0 2 if $locale
1453 2 0 if (scalar keys %filter)
1466 6 0 if ($self->config->http_charset)
1479 6 0 if $return_output
1496 1 2 if ($args{'format'} and $args{'format'} =~ /^rdf$/i) { }
1 1 elsif ($args{'format'} and $args{'format'} eq 'opensearch') { }
1648 3 0 if $args{'return_output'}
1716 0 353 if $new_metadata{'website'} eq 'http://'
1722 1 352 if $new_metadata{'latitude_unmunged'}
1724 1 352 if $new_metadata{'longitude_unmunged'}
1733 339 14 $new_metadata{'edit_type'} eq 'Normal edit' ? :
1742 1 352 if (scalar @{$fails;} or $config->read_only)
1757 1 0 if $return_output
1765 2 350 if ($spam_detector)
1776 1 351 if ($is_spam)
1785 1 0 if $return_output
1797 350 1 if ($in_moderate_whitelist or not $needs_moderation)
1807 349 2 if ($written) { }
1808 2 347 if ($needs_moderation)
1809 1 1 if ($in_moderate_whitelist) { }
1 0 elsif ($config->send_moderation_notifications) { }
1830 0 1 if $@
1835 307 42 if $return_output
1870 2 44 if ($mdvar eq 'locales') { }
2 42 elsif ($mdvar eq 'categories') { }
6 36 elsif ($mdvar eq 'username' or $mdvar eq 'comment' or $mdvar eq 'edit_type') { }
1895 0 2 if $args{'return_tt_vars'}
1901 2 0 if $args{'return_output'}
1959 84 82 unless ($wiki->node_exists($node))
1960 46 38 $type eq 'Category' ? :
1971 81 3 unless ($ok)
1975 0 84 unless ($ok)
2017 0 2 unless my $node = $args{'id'}
2030 2 0 if ($password) { }
2031 0 2 if ($password ne $self->config->admin_pass) { }
2032 0 0 if $return_tt_vars
2038 0 0 if $return_output
2047 0 2 if $check{'version'}
2048 0 2 if $return_tt_vars
2054 2 0 if $return_output
2058 0 0 if $return_tt_vars
2064 0 0 if $return_output
2086 0 7 unless my $node = $args{'id'}
2091 1 6 if ($args{'moderation_flag'} eq '1' or $args{'moderation_flag'} eq 'yes' or $args{'moderation_flag'} eq 'on' or $args{'moderation_flag'} eq 'true') { }
2110 6 1 if ($password) { }
2111 1 5 if ($password ne $self->config->admin_pass) { }
2112 0 1 if $return_tt_vars
2118 1 0 if $return_output
2126 1 4 unless ($worked)
2136 2 3 if $return_output
2140 0 1 if $return_tt_vars
2146 1 0 if $return_output
2169 0 1 unless my $node = $args{'id'}
2170 0 1 unless my $version = $args{'version'}
2185 0 1 unless ($self->config->moderation_requires_password)
2189 1 0 if ($password) { }
2190 0 1 if ($password ne $self->config->admin_pass) { }
2191 0 0 if $return_tt_vars
2197 0 0 if $return_output
2220 0 1 if $return_output
2224 0 0 if $return_tt_vars
2230 0 0 if $return_output
2263 10 4 if ($metadata_type)
2273 1 28 if $exclude_locales and $node =~ /^Locale /
2274 1 27 if $exclude_categories and $node =~ /^Category /
2276 4 23 if 'OpenGuides::Utils'->detect_redirect('content', $data{'content'})
2286 7 16 if ($format eq 'map' and $use_leaflet)
2292 4 3 if (defined $wgs84_lat)
2319 5 9 if ($format eq 'map')
2320 4 1 if ($use_leaflet)
2323 2 2 if (scalar %minmaxdata)
2333 4 10 if $return_tt_vars
2342 10 0 if $return_output
2365 9 0 if ($args{'username'})
2368 0 9 if ($args{'host'})
2371 0 9 unless ($type and $value)
2381 3 6 if ($password) { }
2382 0 3 if ($password ne $self->config->admin_pass) { }
2417 9 0 if $return_tt_vars
2425 0 0 if $return_output
2467 4 6 if ($$node{'name'} =~ /^Category /) { }
2 4 elsif ($$node{'name'} =~ /^Locale /) { }
2482 0 2 if ($args{'moderation_completed'})
2483 0 0 if ($args{'moderation_completed'} eq 'moderation')
2486 0 0 if ($args{'moderation_completed'} eq 'changed')
2489 0 0 if ($args{'moderation_completed'} eq 'unknown_node')
2504 1 1 if $return_tt_vars
2510 1 0 if $return_output
2526 3 170 if ($args{'content_type'})
2544 1 1 if ($type eq 'category') { }
1 0 elsif ($type eq 'locale') { }
2549 1 1 if ($format)
2564 2 355 if $redirected_from
2567 2 355 if $oldid
2569 2 355 if $oldid
2578 0 179 unless my $pref_name = shift()