Branch Coverage

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


line true false branch
53 99 14 if ($geo_handler == 1) { }
4 10 elsif ($geo_handler == 2) { }
70 1 112 if ($self->config->ping_services)
75 0 1 if ($@) { }
83 2 1 if ($well_known{$s}) { }
211 1 105 defined $args{'redirect'} ? :
218 1 105 if ($host_checker)
225 1 105 if ($is_blacklisted)
235 1 0 if $return_output
242 12 93 if ($id =~ /^(Category|Locale) (.*)$/)
257 0 105 if $version and $version == $current_version
259 1 104 if $version
265 88 17 if ($node_data{'content'})
277 0 105 if ($args{'format'} and $args{'format'} eq 'raw')
278 0 0 unless $noheaders
290 88 17 $node_exists ? :
309 1 104 if $args{'version'}
311 92 13 if ($config->show_gmap_in_node_display and $self->get_cookie('display_google_maps'))
318 3 102 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 101 1 unless $version
351 2 100 if ($id eq 'RecentChanges') { }
16 84 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 76 if $args{'return_tt_vars'}
397 76 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 31 if ($since) { }
723 3 3 unless $minor_edits
727 5 1 if (scalar @rc)
736 64 60 unless $minor_edits
742 7 47 if $seen{$node->{'name'}}
746 35 89 if (scalar @filtered)
758 9 28 if (not $since and $self->get_cookie('track_recent_changes_views'))
764 8 29 if $args{'return_tt_vars'}
766 29 0 if $return_output
782 67 63 if ($criteria{'metadata_was'})
786 5 33 if $seen{$node->{'name'}}
853 0 4 if $args{'return_tt_vars'}
859 4 0 if $args{'return_output'}
911 0 0 if $args{'return_tt_vars'}
919 0 0 if $args{'return_output'}
996 2 33 if ($args{'type'} and $args{'value'}) { }
997 0 2 if ($args{'type'} eq 'fuzzy_title_match') { }
1014 1 32 if (not $cat || $loc) { }
1018 17 15 if ($cat)
1034 23 9 if ($loc)
1050 9 23 if ($cat and not $loc) { }
15 8 elsif ($loc and not $cat) { }
1059 8 12 if $count{$node} > 1
1076 17 23 if ($criterion->{'type'} eq 'category') { }
23 0 elsif ($criterion->{'type'} eq 'locale') { }
1101 62 0 if ($node)
1110 0 62 if $@
1114 48 14 if ($use_leaflet)
1115 19 0 if (defined $wgs84_lat and $wgs84_lat =~ /^[-.\d]+$/ and defined $wgs84_long and $wgs84_long =~ /^[-.\d]+$/)
1130 23 10 if ($args{'format'}) { }
1131 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') { }
1142 17 1 if ($use_leaflet) { }
1143 9 8 if ($nodes_on_map) { }
1176 2 0 if ($args{'cat'}) { }
1195 2 0 if $args{'return_output'}
1203 7 24 if $args{'return_tt_vars'}
1211 24 0 if ($args{'return_output'} and not $args{'intercept_redirect'})
1216 24 0 if $args{'return_output'}
1223 2 0 if ($args{'return_output'} or $args{'return_tt_vars'}) { }
1224 2 0 if ($args{'intercept_redirect'}) { }
1229 0 0 if ($type eq 'category') { }
0 0 elsif ($type eq 'locale') { }
1264 0 0 if ($args{'type'} and $args{'type'} ne 'metadata_type') { }
1280 0 0 if $args{'return_tt_vars'}
1285 0 0 if ($args{'format'})
1286 0 0 if ($args{'format'} eq 'json')
1295 0 0 unless ($output)
1303 0 0 if $args{'return_output'}
1305 0 0 if ($content_type)
1349 4 0 if $node_data{'version'}
1360 0 4 if $args{'return_tt_vars'}
1366 4 0 if $return_output
1428 0 6 unless $feed_type
1431 0 6 unless $feed_listing
1433 6 0 $args{'return_output'} ? :
1443 2 4 if ($feed_listing eq 'recent_changes') { }
4 0 elsif ($feed_listing eq 'node_all_versions') { }
1446 2 0 $args{'ignore_minor_edits'} ? :
1453 2 0 if $username
1454 0 2 if $category
1455 0 2 if $locale
1456 2 0 if (scalar keys %filter)
1469 6 0 if ($self->config->http_charset)
1482 6 0 if $return_output
1499 1 2 if ($args{'format'} and $args{'format'} =~ /^rdf$/i) { }
1 1 elsif ($args{'format'} and $args{'format'} eq 'opensearch') { }
1651 3 0 if $args{'return_output'}
1719 0 355 if $new_metadata{'website'} eq 'http://'
1726 1 354 if $new_metadata{'latitude_unmunged'}
1728 1 354 if $new_metadata{'longitude_unmunged'}
1736 341 14 $new_metadata{'edit_type'} eq 'Normal edit' ? :
1745 1 354 if (scalar @{$fails;} or $config->read_only)
1760 1 0 if $return_output
1768 2 352 if ($spam_detector)
1779 1 353 if ($is_spam)
1788 1 0 if $return_output
1800 352 1 if ($in_moderate_whitelist or not $needs_moderation)
1810 351 2 if ($written) { }
1811 2 349 if ($needs_moderation)
1812 1 1 if ($in_moderate_whitelist) { }
1 0 elsif ($config->send_moderation_notifications) { }
1833 0 1 if $@
1838 309 42 if $return_output
1873 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') { }
1898 0 2 if $args{'return_tt_vars'}
1904 2 0 if $args{'return_output'}
1962 86 84 unless ($wiki->node_exists($node))
1963 47 39 $type eq 'Category' ? :
1974 83 3 unless ($ok)
1978 0 86 unless ($ok)
2020 0 2 unless my $node = $args{'id'}
2033 2 0 if ($password) { }
2034 0 2 if ($password ne $self->config->admin_pass) { }
2035 0 0 if $return_tt_vars
2041 0 0 if $return_output
2050 0 2 if $check{'version'}
2051 0 2 if $return_tt_vars
2057 2 0 if $return_output
2061 0 0 if $return_tt_vars
2067 0 0 if $return_output
2089 0 7 unless my $node = $args{'id'}
2094 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') { }
2113 6 1 if ($password) { }
2114 1 5 if ($password ne $self->config->admin_pass) { }
2115 0 1 if $return_tt_vars
2121 1 0 if $return_output
2129 1 4 unless ($worked)
2139 2 3 if $return_output
2143 0 1 if $return_tt_vars
2149 1 0 if $return_output
2172 0 1 unless my $node = $args{'id'}
2173 0 1 unless my $version = $args{'version'}
2188 0 1 unless ($self->config->moderation_requires_password)
2192 1 0 if ($password) { }
2193 0 1 if ($password ne $self->config->admin_pass) { }
2194 0 0 if $return_tt_vars
2200 0 0 if $return_output
2223 0 1 if $return_output
2227 0 0 if $return_tt_vars
2233 0 0 if $return_output
2266 10 4 if ($metadata_type)
2276 1 28 if $exclude_locales and $node =~ /^Locale /
2277 1 27 if $exclude_categories and $node =~ /^Category /
2280 4 23 if 'OpenGuides::Utils'->detect_redirect('content', $data{'content'})
2289 7 16 if ($format eq 'map' and $use_leaflet)
2295 4 3 if (defined $wgs84_lat)
2322 5 9 if ($format eq 'map')
2323 4 1 if ($use_leaflet)
2326 2 2 if (scalar %minmaxdata)
2336 4 10 if $return_tt_vars
2345 10 0 if $return_output
2368 9 0 if ($args{'username'})
2371 0 9 if ($args{'host'})
2374 0 9 unless ($type and $value)
2384 3 6 if ($password) { }
2385 0 3 if ($password ne $self->config->admin_pass) { }
2420 9 0 if $return_tt_vars
2428 0 0 if $return_output
2470 4 6 if ($node->{'name'} =~ /^Category /) { }
2 4 elsif ($node->{'name'} =~ /^Locale /) { }
2485 0 2 if ($args{'moderation_completed'})
2486 0 0 if ($args{'moderation_completed'} eq 'moderation')
2489 0 0 if ($args{'moderation_completed'} eq 'changed')
2492 0 0 if ($args{'moderation_completed'} eq 'unknown_node')
2507 1 1 if $return_tt_vars
2513 1 0 if $return_output
2529 3 174 if ($args{'content_type'})
2547 1 1 if ($type eq 'category') { }
1 0 elsif ($type eq 'locale') { }
2552 1 1 if ($format)
2567 2 357 if $redirected_from
2570 2 357 if $oldid
2572 2 357 if $oldid
2581 0 184 unless my $pref_name = shift()