Branch Coverage

blib/lib/CGI/Ex/App.pm
Criterion Covered Total %
branch 288 344 83.7


line true false branch
19 11 107 @_ % 2 ? :
76 118 ref $_[0] ? :
28 3 189 if $self->load_conf and $_ = $self->conf
33 0 3 unless @_ = grep({/^:?App($|__)/;} @_)
43 12 66 unless ref $self
47 1 77 if not $self->{'_no_pre_navigate'} and $self->pre_navigate
48 75 2 unless $self->{'_morph_lineage'}
52 8 11 if ($err and ref $err || $err ne "Long Jump\n")
53 0 8 unless $self->can("handle_error")
54 2 6 unless (eval { do { $self->handle_error($err); 1 } })
58 0 0 if not $self->{'_no_post_navigate'} || eval { do { $self->post_navigate; 1 } } and $@ and $@ ne "Long Jump\n"
66 2 151 if ($self->{'_recurse'}++ >= $self->recurse_limit)
68 2 0 ($self->{'jumps'} || 0) <= 1 ? :
72 1 148 if $self->pre_loop($path)
76 1 126 unless ($step =~ /^([^\W0-9]\w*)$/)
82 125 1 unless ($self->is_authed)
84 3 122 ref $req ? :
0 118 if ref $req ? $req->{$step} : $req and not $self->run_hook("get_valid_auth", $step)
89 68 36 if ($self->run_hook("run_step", $step))
98 1 56 if $self->post_loop($path)
110 41 35 if (defined $step)
112 1 40 if ($step =~ /^_/) { }
1 39 elsif ($self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step) { }
131 109 88 unless $maps
133 3 15 unless UNIVERSAL::isa($maps, "ARRAY")
135 3 9 unless UNIVERSAL::isa($map, "ARRAY")
136 3 6 unless my(@match) = $info =~ /$map->[0]/
138 1 5 if (UNIVERSAL::isa($map->[1], 'CODE')) { }
149 0 2545 ref $hook eq 'CODE' ? :
150 1 2544 unless $code
152 2513 31 unless $self->{'no_history'}
162 1 2544 unless $hook
163 311 2233 if ($step and my $code = $self->can("${step}_$hook")) { }
2232 1 elsif ($code = $self->can($hook)) { }
173 0 3 unless $hook
174 0 3 unless $step
175 0 3 unless $pkg
184 2 109 if $self->run_hook("pre_step", $step)
185 8 101 if $self->run_hook("skip", $step)
188 72 28 unless ($self->run_hook("prepare", $step) and $self->run_hook("info_complete", $step) and $self->run_hook("finalize", $step))
198 1 27 if $self->run_hook("post_step", $step)
212 4 68 if scalar keys %$hash_errs
229 0 8 if $self->{'_handling_error'}
236 6 0 if $self->run_hook("run_step", $step)
238 0 6 if $@ and $@ ne "Long Jump\n"
246 11 0 unless (+(shift())->{'auth_obj'})
247 3 2 unless $_[0]{'charset'}
249 1 1 unless $_[0]{'conf_die_on_fail'}
250 2 1 unless $_[0]{'conf_path'}
252 59 1 unless $_[0]{'default_step'}
253 7 1 unless $_[0]{'error_step'}
255 4 1 unless $_[0]{'forbidden_step'}
256 79 0 unless $_[0]{'form_name'}
258 17 1 unless $_[0]{'js_step'}
259 8 1 unless $_[0]{'login_step'}
260 3 2 unless $_[0]{'mimetype'}
261 143 28 unless $_[0]{'path_info'} or $ENV{'PATH_INFO'}
262 69 11 unless $_[0]{'path_info_map_base'}
263 143 12 unless $_[0]{'recurse_limit'}
264 29 80 unless $_[0]{'script_name'} or $ENV{'SCRIPT_NAME'}
266 223 1 unless $_[0]{'step_key'}
268 72 1 unless (+(shift())->{'template_obj'})
269 77 1 unless $_[0]{'template_path'}
271 5 5 unless $_[0]{'val_path'}
297 4 139 @_ == 2 ? :
298 1 81 @_ == 2 ? :
299 1 18 @_ == 2 ? :
300 1 13 @_ == 2 ? :
301 1 2 @_ == 2 ? :
302 1 5 @_ == 2 ? :
303 1 6 @_ == 2 ? :
304 1 10 @_ == 2 ? :
305 1 10 @_ == 2 ? :
306 1 194 @_ == 2 ? :
310 1 7 if @_ == 1
313 1 3 unless ref $conf
316 2 0 if ($hash and scalar keys %$hash)
318 1 1 if $err_obj
326 1 9 if @_ == 1
366 6 1 ref $_[0] ? :
368 4 3 $key =~ /error$/ ? :
369 1 6 if ($hash->{$_key}) { }
381 5 5 ref $_[0] ? :
398 6 24 if (not ref $row or ref $row ne "HASH" or not exists $row->{'elapsed'})
405 16 8 if ($all) { }
408 1 3 $resp =~ /^(.{30}|.{0,30}(?=\n))(?s:.)/ ? :
1 4 ref $resp eq 'HASH' && !scalar(keys %$resp) ? :
1 5 ref $resp eq 'ARRAY' && !@$resp ? :
2 6 !defined($resp) ? :
413 0 8 if defined $row->{'info'}
423 2 12 if (my $ref = $self->{'_morph_lineage'})
425 1 1 unless defined $index
435 56 1 if ($i + 1 > $#$ref) { }
443 20 0 @_ == 1 ? :
447 2 18 if ($i eq 'FIRST') { }
1 17 elsif ($i eq 'LAST') { }
1 16 elsif ($i eq 'NEXT') { }
1 15 elsif ($i eq 'CURRENT') { }
1 14 elsif ($i eq 'PREVIOUS') { }
11 3 elsif (not $i =~ /^-?\d+/) { }
455 1 15 if ($path->[$j] eq $i)
461 10 1 unless ($found)
466 0 20 unless $i =~ /^-?\d+$/
469 3 16 $cut_i < 0 ? :
1 19 $cut_i > $#$path ? :
478 1 19 if @$lin
487 13 0 $self->can('path') == \&CGI::Ex::App::path && $self->can('path_info_map_base') == \&CGI::Ex::App::path_info_map_base ? :
497 115 18 if (not $ref && $ref->{'meth'} or $ref->{'meth'} ne "morph")
510 1 20 if (ref $allow and not $allow = $allow->{$step}) { }
0 20 elsif (not $new ||= $self->run_hook('morph_package', $step)) { }
2 18 elsif ($cur eq $new) { }
523 12 6 if (UNIVERSAL::can($new, 'fixup_after_morph') or eval { do { require $file } } and UNIVERSAL::can($new, 'fixup_after_morph')) { }
5 1 elsif ($@) { }
1 0 elsif ($allow ne '1') { }
530 4 1 if ($allow eq '1' and $@ =~ /^\s*(Can\'t locate \S+ in \@INC)/) { }
550 13 18 if ($i + 1 > $#$ref) { }
557 1 2 if $self->{'path_i'}
565 1 42 if $i < 0
573 114 2 if (not $ref && $ref->{'meth'} or $ref->{'meth'} ne "unmorph")
579 15 4 unless @$lin
581 10 9 if ($cur ne $prev) { }
601 4 2 unless $_step =~ /\.\w+$/
602 6 6 if length $_ and not m[/$]
610 1 9 if UNIVERSAL::isa($abs, "CODE")
611 2 8 unless UNIVERSAL::isa($abs, "ARRAY")
612 1 9 if @$abs == 0
621 12 13 if length $_ and not m[/$]
623 1 7 if (@$abs > 1)
626 0 2 if -e $path
634 1 71 unless $fill and scalar keys %$fill
652 0 0 ref $_[0] ? :
668 1 0 $file ? :
674 1 8 unless $self->run_hook("ready_validate", $step)
675 4 4 $self->run_hook('validate', $step, $self->form) ? :
682 2 2 unless $form_name and ref $hash_val and scalar keys %$hash_val
689 0 0 ref $_[3] eq 'HASH' ? :
691 0 0 unless $form_name and ref $hash_val and scalar keys %$hash_val
700 20 0 $cur ? :
708 16 2 $self->script_name =~ / (\w+) (?:\.\w+)? $/x ? :
722 1 3 ref $out eq 'SCALAR' ? :
727 0 12 if ($self->run_hook("validate_when_data", $step) and my(@keys) = keys %{{} unless $self->run_hook("hash_validation", $step);})
728 0 0 unless $self->run_hook("hash_validation", $step)
730 0 0 grep({exists $form->{$_};} @keys) ? :
732 9 3 $ENV{'REQUEST_METHOD'} && $ENV{'REQUEST_METHOD'} eq 'POST' ? :
737 9 27 unless $is_at_end
746 2 3 @_ == 2 ? :
747 2 3 $is_ready ? :
757 0 72 unless $t->process($file, $swap, \$out)
771 1 7 unless ref $hash and scalar keys %$hash
774 4 3 if (my $err_obj = eval { do { $self->val_obj->validate($form, $hash, \@validated_fields) } })
778 0 3 if $@
781 0 0 ref $_ ? :
0 3 if $_ = $ref->{'append_path'}
782 0 0 ref $_ ? :
0 3 if $_ = $ref->{'replace_path'}
783 0 0 ref $_ ? :
0 3 if $_ = $ref->{'insert_path'}
798 0 3 unless ref $self
799 1 2 if $self->can("require_auth") != \&CGI::Ex::App::require_auth
807 5 0 if @_ == 1 and !defined($_[0]) || ref $_[0] || $_[0] =~ /^[01]$/
811 2 136 if $data
829 1 11 if $self->is_authed
830 0 11 unless $self->auth_args
0 11 unless $extra
844 3 1 if defined $data
846 3 1 $resp && $data ? :
856 2 1 $path =~ m[^(?:/js/|/)?(\w+(?:/\w+)*\.js)$] ? :
862 0 3 if (shift())->allow_morph(@_)
867 0 4 if (shift())->allow_morph(@_)
873 0 7 if (shift())->allow_morph(@_)
875 0 7 unless +(shift())->{'__login_hash_common'}
876 0 7 unless +(shift())->{'__login_file_print'}