Branch Coverage

blib/lib/OpenGuides/Utils.pm
Criterion Covered Total %
branch 87 118 73.7


line true false branch
71 1 153 unless my $config = $args{'config'}
72 1 152 unless UNIVERSAL::isa($config, 'OpenGuides::Config')
86 0 152 if $@
100 0 152 if ($config->use_lucy) { }
152 0 elsif ($config->use_plucene and lc $config->use_plucene eq 'y' || $config->use_plucene == 1) { }
109 2 150 if ($munger)
141 2 1 if (UNIVERSAL::isa($_[0], 'Wiki::Toolkit'))
144 3 0 lc $_[0] eq 'category' ? :
169 2 0 if (UNIVERSAL::isa($_[0], 'Wiki::Toolkit'))
173 2 0 lc $_[0] eq 'category' ? :
180 5 0 if (UNIVERSAL::isa($_[0], 'Wiki::Toolkit'))
186 4 1 if ($type and $value) { }
204 2 150 if ($custom_macro_module)
244 0 0 if ($munger)
263 1 8 unless (UNIVERSAL::isa($wiki, 'Wiki::Toolkit'))
264 1 0 if ($args{'include_prefix'}) { }
276 4 4 unless (scalar @nodes)
282 4 4 unless $args{'include_prefix'}
297 0 1 unless (UNIVERSAL::isa($wiki, 'Wiki::Toolkit'))
323 0 185 unless my($longitude, $latitude, $config) = ($args{'longitude'}, $args{'latitude'}, $args{'config'})
326 0 185 unless $config->geo_handler
328 161 24 if ($config->force_wgs84)
334 17 7 unless ($args{'longitude'} or $args{'latitude'})
341 7 0 unless ($helmert)
346 1 6 if ($datum eq 'Airy')
351 0 7 unless ($datum_helper)
363 0 7 unless ($helmert)
368 6 1 if ($config->geo_handler == 1) { }
0 1 elsif ($config->geo_handler == 2) { }
1 0 elsif ($config->geo_handler == 3) { }
375 0 1 if ($config->ellipsoid eq 'WGS-84') { }
411 26 13 if defined $_
415 26 13 if defined $_
420 2 13 unless (scalar @lats and scalar @longs)
446 18 15 $args{'format'} eq 'map' ? :
452 17 23 if ($type eq 'category') { }
461 17 16 if (scalar @cats)
463 8 9 if (scalar @locs)
467 23 10 if (scalar @locs)
488 18 119 unless $args{'content'}
490 9 110 if ($args{'content'} =~ /^#REDIRECT\s+(.+?)\s*$/)
517 0 353 unless $q
518 0 353 if @fails
522 1 705 if ($q->param($var) and not $q->param($var) =~ /^-?\d+$/)
528 0 706 if ($q->param($var) and not $q->param($var) =~ /^-?\d+\.?(\d+)?$/)
533 5 348 if ($q->param('website') and $q->param('website') ne 'http://')
534 0 5 unless (is_web_uri(scalar $q->param('website')))
570 1 1 if (/(.*?)\|(.*)/) { }
615 0 4 unless my $config = $args{'config'}
617 1 3 if $args{'to'}
619 2 2 if $args{'admin'}
620 1 3 unless $to[0]
621 0 3 unless $args{'subject'}
622 0 3 unless $args{'body'}
624 3 0 unless $args{'nobcc'}
634 3 0 if ($args{'return_output'}) { }
637 0 0 unless $msg->send
655 0 351 unless defined $ip
658 1 350 unless my $addr = 'Net::Netmask'->new2($ip)