Branch Coverage

blib/lib/Parse/PMFile.pm
Criterion Covered Total %
branch 154 254 60.6


line true false branch
21 309 4 unless $opts
34 308 6 unless ($self->_version_from_meta_ok)
36 0 267 unless (eval { do { $version = $self->_parse_version; 1 } })
42 0 267 if ($self->{'VERSION'} =~ /^\{.*\}$/) { }
5 262 elsif ($self->{'VERSION'} =~ /[_\s]/ and not $self->{'ALLOW_DEV_VERSION'} and not $ALLOW_DEV_VERSION) { }
63 0 268 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 262 if ($module)
86 0 6 if (lc $module eq lc $package and $module ne $package)
97 0 268 if ($pp->{'version'} and $pp->{'version'} =~ /^\{.*\}$/)
99 0 0 if ($err->{'x_normalize'}) { }
0 0 elsif ($err->{'openerr'}) { }
142 0 532 if (not defined $_ or /^\s*$/ or /\s/)
147 3 265 unless ($self->_version_ok($pp))
157 3 265 wantarray && %errors ? :
162 3 265 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 153 155 if ($self->{'FORK'} or $Parse::PMFile::FORK)
201 0 153 unless defined $pid
203 112 196 if ($pid) { }
205 112 0 if (open my $fh, "<", $tmpfile)
216 196 0 unless ($self->{'UNSAFE'} or $Parse::PMFile::UNSAFE)
232 0 196 if $self->{'UNSAFE'} or $Parse::PMFile::UNSAFE
235 196 0 $comp ? :
237 21 175 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 196 0 if (defined $v) { }
261 21 175 if ref($v) =~ /^version(::vpp)?$/
265 41 155 if ($self->{'FORK'} or $Parse::PMFile::FORK) { }
272 0 155 if defined $v and not length $v
273 155 0 if $comp
278 112 155 if $self->{'FORK'} || $FORK and -e $tmpfile
285 0 176 if $self->{'UNSAFE'} or $UNSAFE
292 0 176 if ($INC{'version/vxs.pm'})
301 0 176 if ($INC{'version/vpp.pm'})
307 0 0 unless ($used_version_in_safe)
312 0 0 unless ($restored)
338 176 0 if (not $restored)
356 0 268 unless open my $fh, "<", "$pmfile"
366 268 5960 unless $checked_bom
368 6 6216 $pline =~ /^=cut/ ? :
6 6222 $pline =~ /^=(?!cut)/ ? :
370 60 6168 if $inpod
371 6 6162 if substr($pline, 0, 4) eq "=cut"
374 1274 4888 if $pline =~ /^\s*$/
375 9 4879 if ($pline =~ /^__(?:END|DATA)__\b/ and not $pmfile =~ /\.PL$/)
394 120 4759 if ($pline =~ /^[\s\{;]*use\s+(?:feature|experimental)\s+[^;]+\b(?:class|all)[^;]*;/)
399 0 4879 if ($pline =~ /^[\s\{;]*use\s+(?:Feature::Compat::Class)[^;]*;/)
402 48 4831 if ($pline =~ /^[\s\{;]*use\s+(?:Object::Pad)[^;]*;/)
409 277 4602 if ($pline =~ / # (.*) # takes too much time if $pline is long #(?
422 0 277 if ($pkg eq "DB")
430 277 4602 if ($pkg) { }
435 0 277 unless $pkg =~ /^[A-Za-z]/
436 0 277 unless $pkg =~ /\w$/
437 6 271 if $pkg eq "main"
442 0 271 if length $pkg > 128
446 265 6 if ($self->_simile($pmfile, $pkg)) { }
448 6 259 if ($self->_version_from_meta_ok) { }
450 6 0 if (exists $provides->{$pkg})
451 6 0 if (defined $provides->{$pkg}{'version'}) { }
453 4 2 if ($v =~ /[_\s]/ and not $self->{'ALLOW_DEV_VERSION'} and not $ALLOW_DEV_VERSION)
457 0 2 unless (eval { do { $version = $self->_normalize_version($v); 1 } })
468 19 240 if (defined $strict_version) { }
471 240 0 defined $version ? :
474 75 184 if ($version eq 'undef') { }
475 0 75 unless defined $ppp->{$pkg}{'version'}
482 0 184 if $version > $ppp->{$pkg}{'version'} or $version gt $ppp->{$pkg}{'version'}
492 6 0 unless defined $ppp->{$pkg}{'version'} and length $ppp->{$pkg}{'version'}
513 0 196 unless open FH, $parsefile
517 0 559 /^=cut/ ? :
0 559 /^=(?!cut)/ ? :
518 0 559 if $inpod or /^\s*#/
519 3 556 if /^__(?:END|DATA)__\b/
523 75 481 if (/^[\s\{;]*use\s+(?:feature|experimental)\s+[^;]+\b(?:class|all)[^;]*;/)
529 0 556 if (/^[\s\{;]*use\s+(?:Feature::Compat::Class)[^;]*;/)
532 33 523 if (/^[\s\{;]*use\s+(?:Object::Pad)[^;]*;/)
537 39 517 if (my($ver) = /$package_or_class \s+ \S+ \s+ (\S+) \s* [:;{]/x)
540 17 22 if version::is_lax($ver)
544 405 134 unless /(?<=])\=(?![=>])/
559 21 113 if ($@ or not defined $result)
571 45 113 unless defined $result
572 6 152 if (ref($result) =~ /^version(?:::vpp)?\b/)
587 9 262 if ($self->{'META_CONTENT'}) { }
590 3 6 if (ref $no_index eq 'HASH') { }
596 0 3 unless my $v = $no_index->{$k}
598 3 0 if (ref $v eq 'ARRAY') { }
601 3 0 if ($ppp =~ /^$ve$rest/) { }
610 0 0 if ($ppp =~ /^$v$rest/) { }
640 6 265 unless ($ret)
642 0 6 if lc $file eq "version"
651 0 269 unless defined $v
656 75 194 if $v eq "undef"
657 0 194 if $v =~ /^\{.*\}$/
660 10 184 if ($v =~ /_/)
667 0 184 unless (version::is_lax($v))
672 0 184 if ($@)
677 27 157 if ($vv eq $v) { }
681 0 157 if ($forced eq $vv) { }
0 157 elsif ($forced =~ /^v(.+)/) { }
688 157 0 if ($forced == $vv)
702 157 0 if ($v =~ /^(\+?)(\d*)(\.(\d*))?/ and defined $2 && length $2 || defined $4 && length $4)
712 157 0 defined $2 ? :
713 157 0 defined $3 ? :
723 266 313 if exists $self->{'VERSION_FROM_META_OK'}
728 307 6 unless $c->{'provides'}
732 0 6 defined $c->{'generated_by'} ? :
733 6 0 unless $mb_v
736 0 0 if $mb_v eq "0.250.0"
738 0 0 if ($mb_v >= "0.19" and $mb_v < "0.26" and not keys %{$$c{"provides"};})
752 0 1085 if $level <= (ref $self && $self->{'VERBOSE'} || $VERBOSE)
766 0 0 if $l eq $r
773 0 0 unless tr/.// > 1 or /^v/
778 0 0 if ($l =~ /^v/ <=> $r =~ /^v/)
780 0 0 if /^v/
787 0 0 if ($] >= "5.006" and $l =~ /^v/ and $r =~ /^v/)
828 0 0 unless $n =~ s/^v//
843 0 0 unless $mantissa =~ s/(\d{1,3})//
856 157 0 if defined $1 and length $1 > 0
861 0 0 if ($] < "5.006")