Branch Coverage

blib/lib/URI/PackageURL.pm
Criterion Covered Total %
branch 53 58 91.3


line true false branch
36 2 42 unless defined $components{'type'}
37 4 38 unless defined $components{'name'}
45 0 0 unless +(shift())->{'scheme'}
59 2 36 if ($components{'type'} eq "cpan")
63 1 37 if ($components{'type'} eq "pypi")
67 10 28 if (grep {$_ eq $components{'type'};} "bitbucket", "deb", "github", "golang", "hex", "npm", "pypi")
74 14 24 if (my $qualifiers = $components{'qualifiers'})
76 1 22 if $_ =~ /\s/
80 3 34 if ($components{'type'} eq "swift")
81 1 2 unless defined $components{'version'}
82 1 1 unless defined $components{'namespace'}
85 2 33 if ($components{'type'} eq "cran")
86 1 1 unless defined $components{'version'}
89 4 30 if ($components{'type'} eq "conan")
91 2 2 if (defined $components{'namespace'} and $components{'namespace'} ne '') { }
93 1 1 unless (defined $components{'qualifiers'}{'channel'})
101 1 1 if (defined $components{'qualifiers'}{'channel'})
134 1 3 if ($s1[1])
136 3 0 if $_ ne "" and $_ ne "."
154 2 2 if ($s2[1])
163 0 3 if ($key eq "checksums")
199 4 0 if $s5[1]
210 3 1 scalar @s6 > 1 ? :
221 3 1 if (scalar @s6 > 1)
237 23 9 if ($self->namespace)
248 27 5 if $self->version
251 13 19 if (my $qualifiers = $self->qualifiers)
254 12 1 if @qualifiers
259 3 29 if $self->subpath