Branch Coverage

blib/lib/Perinci/Access/Schemeless.pm
Criterion Covered Total %
branch 182 296 61.4


line true false branch
44 2161 685 unless $meth =~ /^actionmeta_(.+)/
49 469 216 if ($type eq '*') { }
77 36 0 if ($self->{'cache_size'} > 0)
96 15 15 $path =~ m[/\z] ? :
98 0 30 ref $paths eq 'ARRAY' ? :
99 8 22 if (ref $_ eq 'Regexp') { }
100 4 4 if $path =~ /$_/
102 10 12 if (m[/\z]) { }
103 5 5 if $_ eq $pathslash or index($pathslash, $_) == 0
106 6 6 if $p eq $path or index($pathslash, $p) == 0
119 362 75 $path =~ m[/\z] ? :
121 0 437 ref $paths eq 'ARRAY' ? :
122 52 385 if (ref $_ eq 'Regexp') { }
126 10 375 if (m[/\z]) { }
127 5 1 if $_ eq $pathslash or index($_, $pathslash) == 0 or index($pathslash, $_) == 0
131 62 308 if $p eq $path or index($p, $pathslash) == 0 or index($pathslash, $p) == 0
143 5 79 if (defined $self->{'allow_paths'})
145 4 1 if ($self->{'_actionmetas'}{$req->{'action'}}{'allow_request_parent_path'}) { }
150 1 4 unless $allow
153 1 82 if (defined $self->{'deny_paths'} and __match_paths($path, $self->{'deny_paths'}))
159 3 79 if (defined $self->{'allow_schemes'} and not $sch ~~ $self->{'allow_schemes'})
163 1 78 if (defined $self->{'deny_schemes'} and $sch ~~ $self->{'deny_schemes'})
168 78 0 if ($path =~ m[(.*)/(.*)]) { }
179 0 78 if (defined $self->{'package_prefix'})
180 0 0 length $_ ? :
183 0 78 if $perl_package and not $perl_package =~ /$re_perl_package/
187 43 35 if (length $leaf) { }
188 2 41 if ($leaf =~ /^[%\@\$]/) { }
196 0 35 unless $path =~ m[/\z]
218 1 64 unless $pkg
222 0 64 unless ($self->{'load'})
223 0 0 if package_exists($pkg)
232 18 46 if $INC{$module_p}
239 1 0 "Module $pkg has failed to load previously" . $loadcache{$module_p} ? :
1 45 if exists $INC{$module_p}
243 4 41 if exists $loadcache{$module_p}
254 30 11 if (not $fullpath) { }
7 4 elsif (not $fullpath =~ /\.pm$/) { }
255 29 1 if $pkg_exists
259 7 0 if $pkg_exists
264 1 3 if ($@)
265 0 1 if $ENV{'PERINCI_ACCESS_SCHEMELESS_DEBUG'}
270 1 2 if ($self->{'after_load'})
272 0 1 if ($@)
273 0 0 if $ENV{'PERINCI_ACCESS_SCHEMELESS_DEBUG'}
288 38 6 unless (defined $meta->{'entity_v'})
290 25 13 if (defined $ver)
294 41 3 unless (defined $meta->{'entity_date'})
296 13 28 if (defined $date)
310 5 59 unless (length $pkg)
311 1 4 if (length $leaf) { }
313 0 1 package_exists($pkg) ? :
326 17 42 if ($self->{'_meta_cache'}{$name})
329 0 17 if $self->{'_orig_meta_cache'}{$name}
336 6 36 if $res and not $type eq 'package' && $res->[0] == 405
342 6 30 if (not $meta and $type eq 'package')
346 3 33 unless $meta
354 0 33 if ($res)
355 0 0 if ($res->[0] == 405) { }
0 0 elsif ($res->[0] != 200) { }
363 18 1 if ($type eq 'function' and $self->{'normalize_metadata'})
365 0 18 if ($@)
366 0 0 if $ENV{'PERINCI_ACCESS_SCHEMELESS_DEBUG'}
376 0 18 if ($sfp)
386 33 0 if ($self->{'cache_size'} > 0)
401 6 13 if ($self->{'_code_cache'}{$name})
407 0 13 if $res
411 0 13 unless defined &{$name;}
422 0 13 unless $meta
430 2 11 if (not $self->{'wrap'} or $meta->{'x.perinci.sub.wrapper.logs'} and &first(sub { $_->{'validate_args'}; } , @{$$meta{'x.perinci.sub.wrapper.logs'};}))
442 0 11 $sfp ? :
447 0 11 unless $wrapres->[0] == 200
451 11 0 if ($self->{'cache_size'} > 0)
460 0 11 if ($sfp)
479 0 85 unless $uri
483 0 85 if $res
485 1 84 unless $self->can("actionmeta_$action")
491 6 78 if $res
496 2 76 unless $am->{'applies_to'}[0] eq '*' or $req->{'-type'} ~~ \@{$$am{'applies_to'};}
502 0 76 if ($self->{'debug'})
513 0 2 unless $uri
533 1 6 if $mres
554 4 4 if $mres
559 0 60 if ($req->{'detail'}) { }
586 306 205 if (defined $self->{'allow_paths'} and not __match_paths2($path, $self->{'allow_paths'}))
590 48 157 if (defined $self->{'deny_paths'} and __match_paths2($path, $self->{'deny_paths'}))
600 10 0 unless ($f_type and $f_type ne 'package')
602 9 1 $req->{'-perl_package'} ? :
609 325 62 unless &$filter_path($path)
610 4 58 if $mem{$path}++
611 18 40 if ($detail) { }
620 1 9 if $res and $res->[0] != 405
627 6 124 if $e =~ /^:/
629 29 95 unless &$filter_path($path)
630 0 95 if $mem{$path}++
631 4 91 $e =~ /^[%\@\$]/ ? :
632 0 95 if $f_type and $f_type ne $t
633 29 66 if ($detail) { }
654 5 21 if $res
672 0 19 if (defined $req->{'tx_id'})
674 0 0 if $res
680 0 19 if $res
682 0 19 if $res
687 2 17 if (exists $req->{'argv'} and $self->{'accept_argv'}) { }
693 1 1 unless $res->[0] == 200
701 3 15 if ($req->{'dry_run'})
702 1 2 unless $risub->can_dry_run
704 1 1 if ($risub->feature('dry_run')) { }
714 1 16 if ($risub->feature('progress'))
719 0 17 if ($tm) { }
724 0 0 if $tm
726 1 16 if $req->{'confirm'}
728 1 16 if ($@)
729 0 1 if $ENV{'PERINCI_ACCESS_SCHEMELESS_DEBUG'}
735 7 10 if (defined $res->[2])
736 0 3 if ($req->{'-meta'}{'result'} and $req->{'-meta'}{'result'}{'schema'} and $req->{'-meta'}{'result'}{'schema'}[0] eq 'buf')
754 1 4 unless my $arg = $req->{'arg'}
759 0 4 if $res
774 0 0 unless my $arg = $req->{'arg'}
776 0 0 unless defined(my $index = $req->{'index'})
781 0 0 if $res
797 0 1 unless $res->[0] == 200
808 0 6 unless $res->[0] == 200
826 0 0 unless $req->{'-uri_leaf'} =~ s/^([%\@\$])//
833 0 0 $prefix eq '%' ? :
0 0 $prefix eq '@' ? :
0 0 $prefix eq '$' ? :
842 0 0 unless $self->{'use_tx'}
845 0 0 if (ref $self->{'custom_tx_manager'} eq 'CODE') { }
0 0 elsif (not &blessed($self->{'_tx_manager'})) { }
848 0 0 unless &blessed($self->{'_tx_manager'})
850 0 0 if ($@)
851 0 0 if $ENV{'PERINCI_ACCESS_SCHEMELESS_DEBUG'}
861 0 0 unless &blessed($self->{'_tx_manager'})
863 0 0 if ($@)
864 0 0 if $ENV{'PERINCI_ACCESS_SCHEMELESS_DEBUG'}
870 0 0 if ($tm_cl eq 'Perinci::Tx::Manager')
871 0 0 unless $Perinci::Tx::Manager::VERSION >= 0.29
888 0 0 if $res
904 0 0 if $res
919 0 0 if $res
935 0 0 if $res
951 0 0 if $res
967 0 0 if $res
984 0 0 if $res
1000 0 0 if $res
1016 0 0 if $res
1031 0 0 if $res