Branch Coverage

blib/lib/Parse/PMFile.pm
Criterion Covered Total %
branch 134 240 55.8


line true false branch
21 124 4 unless $opts
34 122 6 unless ($self->_version_from_meta_ok)
36 0 97 unless (eval { do { $version = $self->_parse_version; 1 } })
42 0 97 if ($self->{'VERSION'} =~ /^\{.*\}$/) { }
5 92 elsif ($self->{'VERSION'} =~ /[_\s]/ and not $self->{'ALLOW_DEV_VERSION'} and not $ALLOW_DEV_VERSION) { }
63 0 92 if (not $package =~ /^\w[\w\:\']*\w?\z/ && $package =~ /\w\z/ or $package =~ /:/ and not $package =~ /::/ or $package =~ /\w:\w/ or $package =~ /:::/)
74 0 0 if ($self->{'USERID'} and $self->{'PERMISSIONS'} and not $self->_perm_check($package))
82 6 86 if ($module)
86 0 6 if (lc $module eq lc $package and $module ne $package)
97 0 92 if ($pp->{'version'} and $pp->{'version'} =~ /^\{.*\}$/)
99 0 0 if ($err->{'x_normalize'}) { }
0 0 elsif ($err->{'openerr'}) { }
142 0 180 if (not defined $_ or /^\s*$/ or /\s/)
147 3 89 unless ($self->_version_ok($pp))
157 3 95 wantarray && %errors ? :
162 3 89 if length($pp->{'version'} || 0) > 16
170 0 0 unless $module
171 0 0 if defined $module->m and $module->m eq $userid
172 0 0 if defined $module->f and $module->f eq $userid
173 0 0 if defined $module->c and grep {$_ eq $userid;} @{$module->c;}
199 61 61 if ($self->{'FORK'} or $Parse::PMFile::FORK)
201 0 61 unless defined $pid
203 36 86 if ($pid) { }
205 36 0 if (open my $fh, '<', $tmpfile)
216 86 0 unless ($self->{'UNSAFE'} or $Parse::PMFile::UNSAFE)
232 0 86 if $self->{'UNSAFE'} or $Parse::PMFile::UNSAFE
235 86 0 $comp ? :
237 21 65 if ($@)
240 21 0 if (ref $err) { }
241 21 0 if ($err->{'line'} =~ /([\$*])([\w\:\']*)\bVERSION\b.*?\=(.*)/)
244 21 0 if $err->{'line'} =~ /use\s+version\b|version\->|qv\(/
245 21 0 $comp ? :
246 0 21 if $sigil eq '*' and ref $v
248 0 21 if ($@ or not $v)
259 86 0 if (defined $v) { }
261 21 65 if ref($v) =~ /^version(::vpp)?$/
265 25 61 if ($self->{'FORK'} or $Parse::PMFile::FORK) { }
272 0 61 if defined $v and not length $v
273 61 0 if $comp
278 36 61 if $self->{'FORK'} || $FORK and -e $tmpfile
285 0 82 if $self->{'UNSAFE'} or $UNSAFE
292 0 82 if ($INC{'version/vxs.pm'})
301 0 82 if ($INC{'version/vpp.pm'})
307 0 0 unless ($used_version_in_safe)
312 0 0 unless ($restored)
338 82 0 if (not $restored)
356 0 98 unless open my $fh, '<', "$pmfile"
364 0 5266 $pline =~ /^=cut/ ? :
0 5266 $pline =~ /^=(?!cut)/ ? :
366 0 5266 if $inpod
367 0 5266 if substr($pline, 0, 4) eq '=cut'
370 1106 4160 if $pline =~ /^\s*$/
371 9 4151 if ($pline =~ /^__(?:END|DATA)__\b/ and not $pmfile =~ /\.PL$/)
380 101 4050 if ($pline =~ / # (.*) # takes too much time if $pline is long #(?
392 0 101 if ($pkg eq 'DB')
400 101 4050 if ($pkg) { }
405 0 101 unless $pkg =~ /^[A-Za-z]/
406 0 101 unless $pkg =~ /\w$/
407 6 95 if $pkg eq 'main'
412 0 95 if length $pkg > 128
416 95 0 if ($self->_simile($pmfile, $pkg)) { }
418 6 89 if ($self->_version_from_meta_ok) { }
420 6 0 if (exists $provides->{$pkg})
421 6 0 if (defined $provides->{$pkg}{'version'}) { }
423 4 2 if ($v =~ /[_\s]/ and not $self->{'ALLOW_DEV_VERSION'} and not $ALLOW_DEV_VERSION)
427 0 2 unless (eval { do { $version = $self->_normalize_version($v); 1 } })
438 3 86 if (defined $strict_version) { }
441 86 0 defined $version ? :
444 3 86 if ($version eq 'undef') { }
445 0 3 unless defined $ppp->{$pkg}{'version'}
452 0 86 if $version > $ppp->{$pkg}{'version'} or $version gt $ppp->{$pkg}{'version'}
462 0 0 unless defined $ppp->{$pkg}{'version'} and length $ppp->{$pkg}{'version'}
482 0 86 unless open FH, $parsefile
485 0 257 /^=cut/ ? :
0 257 /^=(?!cut)/ ? :
486 0 257 if $inpod or /^\s*#/
487 3 254 if /^__(?:END|DATA)__\b/
490 6 248 if (my($ver) = /package \s+ \S+ \s+ (\S+) \s* [;{]/x)
493 3 3 if version::is_lax($ver)
497 171 80 unless /(?<=])\=(?![=>])/
512 21 59 if ($@ or not defined $result)
524 3 59 unless defined $result
525 6 56 if (ref($result) =~ /^version(?:::vpp)?\b/)
540 9 86 if ($self->{'META_CONTENT'}) { }
543 3 6 if (ref $no_index eq 'HASH') { }
549 0 3 unless my $v = $no_index->{$k}
551 3 0 if (ref $v eq 'ARRAY') { }
554 3 0 if ($ppp =~ /^$ve$rest/) { }
563 0 0 if ($ppp =~ /^$v$rest/) { }
593 0 95 unless ($ret)
595 0 0 if lc $file eq 'version'
604 0 99 unless defined $v
609 3 96 if $v eq 'undef'
610 0 96 if $v =~ /^\{.*\}$/
613 10 86 if ($v =~ /_/)
620 0 86 unless (version::is_lax($v))
625 0 86 if ($@)
630 27 59 if ($vv eq $v) { }
634 0 59 if ($forced eq $vv) { }
0 59 elsif ($forced =~ /^v(.+)/) { }
641 59 0 if ($forced == $vv)
655 59 0 if ($v =~ /^(\+?)(\d*)(\.(\d*))?/ and defined $2 && length $2 || defined $4 && length $4)
665 59 0 defined $2 ? :
666 59 0 defined $3 ? :
676 95 128 if exists $self->{'VERSION_FROM_META_OK'}
681 122 6 unless $c->{'provides'}
685 0 6 defined $c->{'generated_by'} ? :
686 6 0 unless $mb_v
689 0 0 if $mb_v eq '0.250.0'
691 0 0 if ($mb_v >= 0.19 and $mb_v < 0.26 and not keys %{$$c{'provides'};})
705 0 399 if $level <= (ref $self && $self->{'VERBOSE'} || $VERBOSE)
719 0 0 if $l eq $r
726 0 0 unless tr/.// > 1 or /^v/
731 0 0 if ($l =~ /^v/ <=> $r =~ /^v/)
733 0 0 if /^v/
740 0 0 if ($] >= 5.006 and $l =~ /^v/ and $r =~ /^v/)
781 0 0 unless $n =~ s/^v//
796 0 0 unless $mantissa =~ s/(\d{1,3})//
809 59 0 if defined $1 and length $1 > 0
814 0 0 if ($] < 5.006)