Branch Coverage

blib/lib/Module/Metadata.pm
Criterion Covered Total %
branch 141 184 76.6


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'}) { }
107 1 100 unless defined $filename and -f $filename
115 1 4 unless defined $handle and defined $filename
130 1 5 unless defined $filename and -f $filename
207 0 2 if @_ % 2
211 0 2 if $args{'dir'} and $args{'files'}
214 0 2 unless defined $args{'version'}
217 0 2 unless grep(($args{'version'} eq $_), ('1.4', '2'))
219 1 1 unless defined $args{'prefix'}
222 2 0 if ($args{'dir'}) { }
227 0 0 unless ref $args{'files'} eq 'ARRAY'
232 2 0 if (length $args{'prefix'})
247 1 3 if ($files) { }
253 3 3 if -f $_ and /\.pm$/
270 4 16 if $package eq 'main'
271 4 12 if $package eq 'DB'
272 4 8 if grep /^_/, split(/::/, $package, 0)
276 4 4 if lc $prime_package eq lc $package
277 4 4 if ($package eq $prime_package) { }
278 0 4 if (exists $prime{$package}) { }
282 4 0 if lc "$package.pm" eq lc $mapped_filename
284 4 0 if defined $version
302 0 4 if (exists $prime{$package}) { }
304 0 0 if ($result->{'err'}) { }
0 0 elsif (defined $result->{'version'}) { }
319 0 0 if (exists $prime{$package}{'version'} and defined $prime{$package}{'version'}) { }
323 0 0 if (&$compare_versions($prime{$package}{'version'}, '!=', $result->{'version'}))
352 0 4 if ($result->{'err'})
363 4 0 if defined $result->{'version'}
388 0 109 if scalar %props
405 105 4 unless ($handle)
407 0 105 unless open $handle, '<', $filename
416 104 5 unless ($self->{'module'} and length $self->{'module'})
418 95 9 if ($self->{'filename'} =~ /\.pm$/) { }
429 8 1 if (grep /main/, @{$$self{'packages'};} or grep /main/, keys %{$$self{'versions'};}) { }
441 85 24 if defined $self->{'module'}
455 0 9 if -e $testfile and not -d _
459 6 3 if -e $testfile
467 1 6 unless my $found = (shift())->_do_find_module(@_)
473 0 0 unless my $found = (shift())->_do_find_module(@_)
485 114 19 if ($line =~ /$VERS_REGEXP/o)
486 3 111 $2 ? :
487 20 94 if ($package)
488 5 15 $package eq '::' ? :
502 0 105 unless defined $pos
506 0 105 unless defined $count and $count >= 2
509 1 104 if ($buf eq "\376\377") { }
1 103 elsif ($buf eq "\377\376") { }
1 102 elsif ($buf eq "\357\273") { }
518 1 0 if (defined $count and $count >= 1 and $buf eq "\277")
523 3 102 if (defined $encoding) { }
524 3 0 if ("$]" >= 5.008)
529 0 102 unless seek $fh, $pos, 0
554 89 1562 if ($line =~ /^=([a-zA-Z].*)/)
562 430 1221 if ($in_pod) { }
9 1212 elsif ($is_cut) { }
564 42 388 if ($line =~ /^=head[1-4]\s+(.+)\s*$/) { }
12 376 elsif ($self->{'collect_pod'}) { }
566 1 41 if ($self->{'collect_pod'} and length $pod_data)
578 1 8 if ($self->{'collect_pod'} and length $pod_data)
587 2 1210 if $in_end
590 98 1112 if $line =~ /^\s*#/
593 2 1110 if ($line eq '__END__')
598 1 1109 if $line eq '__DATA__'
601 133 976 index($line, 'VERSION') >= 1 ? :
606 134 975 if ($line =~ /$PKG_REGEXP/o) { }
20 955 elsif ($version_fullname and $version_package) { }
8 947 elsif ($package eq 'main' and $version_fullname and not exists $vers{'main'}) { }
8 939 elsif ($package eq 'main' and not exists $vers{'main'} and $line =~ /\w/) { }
83 1709 elsif ($version_fullname and $need_vers) { }
609 130 4 unless grep(($package eq $_), @packages)
610 6 128 defined $version ? :
612 6 128 if (not exists $vers{$package} and defined $version)
615 0 6 unless defined $dwim_version
624 7 13 if $version_package eq $package
626 18 2 unless (defined $vers{$version_package} and length $vers{$version_package})
651 83 0 unless (defined $vers{$package} and length $vers{$package})
657 1 108 if ($self->{'collect_pod'} and length $pod_data)
693 109 0 if $eval =~ /^(.+)/s
700 0 109 if ($@ =~ /Can't locate/ and -d 'lib')
704 0 109 if $@
707 0 109 unless ref $vsub eq 'CODE'
712 0 109 if $@
719 0 109 unless defined $version
767 5 110 if ref $result eq 'version'
773 12 110 if $@
774 110 12 if defined $version
777 0 110 unless defined $version
797 85 15 if (defined $mod and length $mod and exists $self->{'versions'}{$mod}) { }
809 2 2 if (defined $sect and length $sect and exists $self->{'pod'}{$sect}) { }
824 6 2 if $package