Branch Coverage

blib/lib/Respite/Base.pm
Criterion Covered Total %
branch 88 216 40.7


line true false branch
22 0 0 $meta->{'log_prefix'} ? :
24 0 0 if $self->_restrict($meth)
29 0 0 if ($enc) { }
30 0 0 if $trp eq "json"
32 0 0 if $trp and $trp ne "json"
49 0 0 if $begin
52 0 0 ref $resp eq 'HASH' && exists $resp->{'_utf8_encoded'} ? :
0 0 if ref $resp eq 'HASH' && exists $resp->{'_utf8_encoded'} ? delete $resp->{'_utf8_encoded'} : $enc
58 0 0 if __PACKAGE__->SUPER::can($meth)
64 31 0 $Respite::Base::AUTOLOAD =~ /::(\w+)$/ ? :
65 0 31 unless builtin::blessed($self)
67 0 31 if $self->{'_autoload'}{$meth} > $max_recurse
78 0 9 if ${"${ref}::api_meta";}
79 0 0 $ref eq __PACKAGE__ ? :
86 0 0 if (UNIVERSAL::isa($d, 'HASH')) { }
0 0 elsif (UNIVERSAL::isa($d, 'ARRAY')) { }
87 0 0 ref $v ? :
0 0 if ref $v ? _encode_utf8_recurse($v) : $v and utf8::is_utf8($v)
89 0 0 ref $v ? :
0 0 if ref $v ? _encode_utf8_recurse($v) : $v and utf8::is_utf8($v)
96 0 0 if $seen->{$d}++
97 0 0 if (UNIVERSAL::isa($d, 'HASH')) { }
0 0 elsif (UNIVERSAL::isa($d, 'ARRAY')) { }
98 0 0 ref $v ? :
0 0 if ref $v ? _decode_utf8_recurse($v, $seen) : $v and not utf8::is_utf8($v)
100 0 0 ref $v ? :
0 0 if ref $v ? _decode_utf8_recurse($v, $seen) : $v and not utf8::is_utf8($v)
109 3 0 unless ($val_hash)
110 0 3 unless my $code = $self->can("${sub}__meta")
113 0 0 if (my $ra = $meta->{'requires_admin'} and eval { do { $self->api_meta->{'enforce_requires_admin'} } } || do { my $e = $@; die $e if $e and !ref($e) || $e->{'type'} ne 'no_meta'; 0 })
114 0 0 ref $ra eq 'HASH' ? :
0 0 ref $ra eq 'CODE' ? :
121 1 0 $args->{'_no_trace'} ? :
125 0 0 $_[0]{'base'} ? :
0 1 unless $_[0]{'api_ip'}
126 0 1 $_[0]{'base'} ? :
1 0 unless $_[0]{'api_brand'}
127 0 0 $_[0]{'base'} ? :
0 0 unless $_[0]{'remote_ip'}
128 0 0 $_[0]{'base'} ? :
0 0 unless $_[0]{'remote_user'}
130 0 0 $_[0]{'base'} ? :
0 0 unless $_[0]{'admin_user'}
132 0 1 $_[0]{'base'} ? :
1 0 unless $_[0]{'transport'}
133 0 0 if (exists $_[0]{'is_server'}) { }
135 0 0 eval { do { (shift())->admin_user } } ? :
137 0 1 $_[0]->transport =~ /^(?:cmdline|gui)$/ ? :
142 0 0 unless ($self->{'base'})
143 0 0 if $self->{'called_from_base'}
145 0 0 if ref $self eq $class
147 0 0 unless eval { do { require $file } }
161 7 6 unless $meta->{'methods'}
162 31 9 if ($meth) { }
9 0 elsif (not $cache->{'--load--'}{'builtin'}++) { }
163 23 8 if exists $cache->{$meth}
164 0 8 if exists $cache->{$meth}
166 0 8 if $code = $self->can($meth) and $code ne \&{'Respite::Base' . "::$meth";}
167 3 5 if $code = $self->can("__$meth")
172 7 9 if $pkg ne __PACKAGE__
174 146 320 unless defined &{"${pkg}::$meth";}
175 288 32 $pkg eq __PACKAGE__ ? :
266 54 if $pkg eq __PACKAGE__ ? !($meth =~ /^__/) : defined &{'Respite::Base' . "::$meth";}
176 0 54 if $pkg =~ /^_[a-z]/
177 0 9 unless $meth =~ /__meta$/ or $meth =~ /^__/ or defined &{"${pkg}::${meth}__meta";}
186 4 11 if $type eq "lib_dirs"
189 20 7 if ref $opt ne "HASH"
190 0 4 $opt->{'full_name'} ? :
6 4 !($meth =~ /^${ns}_*(\w+)$/) ? :
17 10 !$meth ? :
192 1 20 unless ($pkg->can("new"))
194 0 1 unless (eval { do { require ($opt->{'file'} ||= $file) } })
198 1 0 if $opt->{'file'} ne $file
203 19 2 $qr eq '1' || $qr eq '*' ? :
21 0 if $qr and not ref $qr
206 58 53 unless defined &{"${pkg}::$meth";}
207 0 53 $pkg eq __PACKAGE__ ? :
4 49 if $pkg eq __PACKAGE__ ? !($meth =~ /^__/) : defined &{'Respite::Base' . "::$meth";}
208 0 49 if $meth =~ /^_[a-z]/
209 0 49 if $qr and not $meth =~ /$qr/
210 16 10 unless $meth =~ /__meta$/ or $meth =~ /^__/ or defined &{"${pkg}::${meth}__meta";}
212 33 0 unless $opt->{'full_name'} or $name =~ /^\Q$ns\E_/
219 0 1 unless $ok
222 21 0 $dt eq 'cache' ? :
1 21 $dt eq 'morph' ? :
9 22 $dt eq 'new' ? :
224 2 0 if ($meta->{'allow_nested'} || $opt->{'allow_nested'} and defined &{"${pkg}::api_meta";} and $pkg->can("find_method"))
227 0 18 if $qr and not $meth =~ /$qr/
228 18 0 !($opt->{'full_name'} || $meth =~ /^\Q$ns\E_/) ? :
232 4 0 if $meth and $cache->{$meth}
236 1 9 if $meth
242 0 3 if ($NS eq 1)
243 0 0 if ref $self eq __PACKAGE__
245 0 0 unless (my $dir = $INC{$file} || '') =~ s/\.pm$//
250 0 3 unless (opendir my $dh, $dir)
252 3 0 if ref $opt ne "HASH"
253 0 3 $opt->{'pkg_prefix'} ? :
255 9 3 unless $sub =~ /^([a-zA-Z]\w*)\.pm$/
257 0 3 if $opt->{'pkg_exclude'} and $pkg =~ /$opt->{'pkg_exclude'}/
284 2 0 !$args->{'method'} ? :
287 22 14 unless $meth =~ /^(\w+)__meta$/
289 0 14 if $qr and not $name =~ /$qr/
291 0 0 if $ENV{'REQUEST_METHOD'} and $meta->{'no_listing'}
292 0 14 $meta->{'no_listing'} ? :
0 14 $args->{'meta'} ? :
314 0 1 if $args->{'sleep'}
315 0 1 if $args->{'fail'}
323 0 1 $args->{'test_auth'} && $self->require_admin ? :