Branch Coverage

blib/lib/JSON/WebToken.pm
Criterion Covered Total %
branch 51 52 98.0


line true false branch
60 2 20 unless (ref $claims eq 'HASH')
78 1 19 if ($algorithm ne 'none' and not defined $secret)
102 2 23 if (ref $accepted_algorithms eq 'ARRAY') { }
5 18 elsif (defined $accepted_algorithms) { }
106 3 2 if ($accepted_algorithms =~ /^[01]$/) { }
108 2 1 !!$accepted_algorithms ? :
119 1 24 unless (defined $jwt)
126 10 14 unless defined $verify_signature
127 1 23 if ($verify_signature and not defined $secret)
135 2 21 unless (@$segments >= 2 and @$segments <= 4)
149 14 6 if $$header{'alg'} ne 'none' and $verify_signature
151 1 20 if (my $e = $@)
158 1 19 unless $verify_signature
162 3 16 unless (grep {$_ eq $algorithm;} @$accepted_algorithms)
169 2 14 if (ref $secret eq 'CODE')
173 1 15 if ($algorithm eq 'none' and $crypto_segment)
180 1 14 unless ($class->_verify($algorithm, $signature_input, $secret, $signature))
197 0 2 unless ($algorithm and $signing_class)
209 4 15 if $algorithm eq 'none'
217 2 13 if $algorithm eq 'none'
226 17 11 if $alg_to_class{$algorithm}
229 1 10 unless ($klass)
236 1 9 $klass =~ s/^\+// ? :
237 4 6 if $class_loaded{$signing_class}
239 4 2 unless $class->_is_inner_package($signing_class)
250 2 4 %{"${klass}::";} ? :