Branch Coverage

blib/lib/Module/Metadata.pm
Criterion Covered Total %
branch 145 188 77.1


line true false branch
26 0 8 unless eval { do { require Fcntl; "Fcntl"->import("SEEK_SET"); 1 } }
29 0 8 if ($INC{'Log/Contextual.pm'}) { }
118 1 110 unless defined $filename and -f $filename
126 1 4 unless defined $handle and defined $filename
141 1 6 unless defined $filename and -f $filename
218 0 2 if @_ % 2
222 0 2 if $args{'dir'} and $args{'files'}
225 0 2 unless defined $args{'version'}
228 0 2 unless grep(($args{'version'} eq $_), ("1.4", 2))
230 1 1 unless defined $args{'prefix'}
233 2 0 if ($args{'dir'}) { }
238 0 0 unless ref $args{'files'} eq "ARRAY"
243 2 0 if (length $args{'prefix'})
258 1 3 if ($files) { }
264 3 3 if -f $_ and /\.pm$/
281 4 16 if $package eq "main"
282 4 12 if $package eq "DB"
283 4 8 if grep /^_/, split(/::/, $package, 0)
287 4 4 if lc $prime_package eq lc $package
288 4 4 if ($package eq $prime_package) { }
289 0 4 if (exists $prime{$package}) { }
293 4 0 if lc "$package.pm" eq lc $mapped_filename
295 4 0 if defined $version
313 0 4 if (exists $prime{$package}) { }
315 0 0 if ($result->{'err'}) { }
0 0 elsif (defined $result->{'version'}) { }
330 0 0 if (exists $prime{$package}{'version'} and defined $prime{$package}{'version'}) { }
334 0 0 if (&$compare_versions($prime{$package}{'version'}, "!=", $result->{'version'}))
363 0 4 if ($result->{'err'})
374 4 0 if defined $result->{'version'}
399 0 120 if scalar %props
416 116 4 unless ($handle)
418 0 116 unless open $handle, "<", $filename
427 114 6 unless ($self->{'module'} and length $self->{'module'})
429 105 9 if ($self->{'filename'} =~ /\.pm$/) { }
440 8 1 if (grep /main/, @{$$self{'packages'};} or grep /main/, keys %{$$self{'versions'};}) { }
452 94 26 if defined $self->{'module'}
466 0 10 if -e $testfile and not -d _
470 7 3 if -e $testfile
478 1 7 unless my $found = (shift())->_do_find_module(@_)
484 0 0 unless my $found = (shift())->_do_find_module(@_)
496 117 20 if ($line =~ /$VERS_REGEXP/o)
497 3 114 $2 ? :
498 20 97 if ($package)
499 5 15 $package eq '::' ? :
513 0 116 unless defined $pos
517 0 116 unless defined $count and $count >= 2
520 1 115 if ($buf eq "\376\377") { }
1 114 elsif ($buf eq "\377\376") { }
1 113 elsif ($buf eq "\357\273") { }
529 1 0 if (defined $count and $count >= 1 and $buf eq "\277")
534 3 113 if (defined $encoding) { }
535 3 0 if ("$]" >= "5.008")
540 0 113 unless seek $fh, $pos, 0
566 95 1621 if ($line =~ /^=([a-zA-Z].*)/)
574 450 1266 if ($in_pod) { }
10 1256 elsif ($is_cut) { }
576 44 406 if ($line =~ /^=head[1-4]\s+(.+)\s*$/) { }
25 381 elsif ($self->{'collect_pod'}) { }
578 4 40 if ($self->{'collect_pod'} and length $pod_data)
585 1 24 if ($self->{'decode_pod'} and $line =~ /^=encoding ([\w-]+)/)
593 2 8 if ($self->{'collect_pod'} and length $pod_data)
602 2 1254 if $in_end
605 98 1156 if $line =~ /^\s*#/
608 2 1154 if ($line eq "__END__")
613 1 1153 if $line eq "__DATA__"
616 137 1016 index($line, 'VERSION') >= 1 ? :
621 146 1007 if ($line =~ /$PKG_REGEXP/o or $line =~ /$CLASS_REGEXP/x) { }
20 987 elsif ($version_fullname and $version_package) { }
8 979 elsif ($package eq 'main' and $version_fullname and not exists $vers{'main'}) { }
9 970 elsif ($package eq 'main' and not exists $vers{'main'} and $line =~ /\w/) { }
86 1765 elsif ($version_fullname and $need_vers) { }
624 142 4 unless grep(($package eq $_), @packages)
625 12 134 defined $version ? :
627 12 134 if (not exists $vers{$package} and defined $version)
630 0 12 unless defined $dwim_version
639 7 13 if $version_package eq $package
641 18 2 unless (defined $vers{$version_package} and length $vers{$version_package})
666 86 0 unless (defined $vers{$package} and length $vers{$package})
672 1 119 if ($self->{'collect_pod'} and length $pod_data)
676 1 119 if ($self->{'decode_pod'} and $encoding)
713 112 0 if $eval =~ /^(.+)/s
720 0 112 if ($@ =~ /Can't locate/ and -d "lib")
724 0 112 if $@
727 0 112 unless ref $vsub eq "CODE"
732 0 112 if $@
739 0 112 unless defined $version
787 5 119 if ref $result eq "version"
793 12 119 if $@
794 119 12 if defined $version
797 0 119 unless defined $version
817 92 16 if (defined $mod and length $mod and exists $self->{'versions'}{$mod}) { }
829 3 2 if (defined $sect and length $sect and exists $self->{'pod'}{$sect}) { }
844 6 2 if $package