Branch Coverage

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


line true false branch
71 1 154 unless my $config = $args{'config'}
72 1 153 unless UNIVERSAL::isa($config, 'OpenGuides::Config')
86 0 153 if $@
100 0 153 if ($config->use_lucy) { }
153 0 elsif ($config->use_plucene and lc $config->use_plucene eq 'y' || $config->use_plucene == 1) { }
109 2 151 if ($munger)
141 2 1 if (UNIVERSAL::isa($_[0], 'Wiki::Toolkit'))
144 3 0 lc $_[0] eq 'category' ? :
169 4 0 if (UNIVERSAL::isa($_[0], 'Wiki::Toolkit'))
173 3 1 lc $_[0] eq 'category' ? :
180 5 0 if (UNIVERSAL::isa($_[0], 'Wiki::Toolkit'))
186 4 1 if ($type and $value) { }
204 2 151 if ($custom_macro_module)
245 0 0 if ($munger)
264 1 10 unless (UNIVERSAL::isa($wiki, 'Wiki::Toolkit'))
265 1 0 if ($args{'include_prefix'}) { }
277 4 6 unless (scalar @nodes)
283 4 8 unless $args{'include_prefix'}
300 0 1 unless (UNIVERSAL::isa($wiki, 'Wiki::Toolkit'))
328 0 189 unless my($longitude, $latitude, $config) = ($args{'longitude'}, $args{'latitude'}, $args{'config'})
329 0 189 unless $config->geo_handler
331 165 24 if ($config->force_wgs84)
337 17 0 unless ($args{'longitude'} or $args{'latitude'})
344 7 0 unless ($helmert)
349 1 6 if ($datum eq 'Airy')
354 0 7 unless ($datum_helper)
366 0 7 unless ($helmert)
371 6 1 if ($config->geo_handler == 1) { }
0 1 elsif ($config->geo_handler == 2) { }
1 0 elsif ($config->geo_handler == 3) { }
378 0 1 if ($config->ellipsoid eq 'WGS-84') { }
415 26 13 if defined $_
419 26 13 if defined $_
423 2 13 unless (scalar @lats and scalar @longs)
449 18 15 $args{'format'} eq 'map' ? :
455 17 23 if ($type eq 'category') { }
464 17 16 if (scalar @cats)
466 8 9 if (scalar @locs)
470 23 10 if (scalar @locs)
491 18 123 unless $args{'content'}
493 9 114 if ($args{'content'} =~ /^#REDIRECT\s+(.+?)\s*$/)
520 0 355 unless $q
521 0 355 if @fails
525 1 709 if ($q->param($var) and not $q->param($var) =~ /^-?\d+$/)
531 0 710 if ($q->param($var) and not $q->param($var) =~ /^-?\d+\.?(\d+)?$/)
536 5 350 if ($q->param('website') and $q->param('website') ne 'http://')
537 0 5 unless (is_web_uri(scalar $q->param('website')))
573 1 1 if (/(.*?)\|(.*)/) { }
618 0 4 unless my $config = $args{'config'}
620 1 3 if $args{'to'}
622 2 2 if $args{'admin'}
623 1 3 unless $to[0]
624 0 3 unless $args{'subject'}
625 0 3 unless $args{'body'}
627 3 0 unless $args{'nobcc'}
637 3 0 if ($args{'return_output'}) { }
640 0 0 unless $msg->send
658 0 353 unless defined $ip
661 1 352 unless my $addr = 'Net::Netmask'->new2($ip)