Branch Coverage

blib/lib/URI/PackageURL.pm
Criterion Covered Total %
branch 44 54 81.4


line true false branch
29 9 1636 unless my $type = delete $params{'type'}
31 10 1626 unless my $name = delete $params{'name'}
50 1626 0 if $validate
92 26 473 unless ($string =~ /$PURL_REGEXP/)
112 43 430 if ($s1[1])
114 103 0 if $_ ne "" and $_ ne "."
133 192 281 if ($s2[1])
142 5 305 if ($key eq "checksums" or $key eq "checksum")
143 0 5 if $key eq "checksums"
160 0 473 unless $s3[0]
161 0 473 unless $s3[1]
179 0 473 unless $components{'type'} =~ /^[a-z][a-z0-9.-]+$/
180 0 473 unless $s4[1]
194 2 17 if ($components{'type'} eq "npm" and $s4[1] =~ /^@/ and not $s4[1] =~ /\@.*@/)
198 420 53 if $s5[1]
217 9 464 unless $components{'name'}
228 261 203 if (@s6)
253 2190 183 if ($self->namespace)
264 2325 48 if $self->version
267 2373 0 if (my $qualifiers = $self->qualifiers)
271 5 4741 if (defined $qualifiers->{$_} and ref $qualifiers->{$_} eq "ARRAY")
277 0 2373 if (defined $qualifiers->{'vers'} and ref $qualifiers->{'vers'} eq "URI::VersionRange")
285 2065 308 if @qualifiers
290 49 2324 if ($self->subpath)
321 927 33153 if (@_ == 3)
334 9214 0 unless $pattern
356 9 1579 unless $string