Condition Coverage

blib/lib/CGI/Ex/App.pm
Criterion Covered Total %
condition 241 325 74.1


and 2 conditions

line l !l condition
316 1 2 $hash and scalar keys %$hash

and 3 conditions

line !l l&&!r l&&r condition
28 189 1 4 $self->load_conf and $_ = $self->conf
47 1 76 1 not $self->{'_no_pre_navigate'} and $self->pre_navigate
52 59 11 8 $err and ref $err || $err ne "Long Jump\n"
58 76 0 0 not $self->{'_no_post_navigate'} || eval { do { $self->post_navigate; 1 } } and $@
0 0 0 not $self->{'_no_post_navigate'} || eval { do { $self->post_navigate; 1 } } and $@ and $@ ne "Long Jump\n"
84 117 8 0 ref $req ? $req->{$step} : $req and not $self->run_hook("get_valid_auth", $step)
112 36 1 3 $self->valid_steps and not $self->valid_steps->{$step}
37 1 2 $self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step
2 1 1 $self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step
163 9 2224 311 $step and my $code = $self->can("${step}_$hook")
188 1 67 33 $self->run_hook("prepare", $step) and $self->run_hook("info_complete", $step)
67 5 28 $self->run_hook("prepare", $step) and $self->run_hook("info_complete", $step) and $self->run_hook("finalize", $step)
238 6 0 0 $@ and $@ ne "Long Jump\n"
408 4 1 1 ref $resp eq 'ARRAY' && !@$resp
3 1 1 ref $resp eq 'HASH' && !scalar(keys %$resp)
487 0 0 13 $self->can('path') == \&CGI::Ex::App::path && $self->can('path_info_map_base') == \&CGI::Ex::App::path_info_map_base
497 76 0 57 $ref && $ref->{'meth'}
510 19 1 1 ref $allow and not $allow = $allow->{$step}
523 5 1 0 eval { do { require $file } } and UNIVERSAL::can($new, "fixup_after_morph")
530 1 0 4 $allow eq 1 and $@ =~ /^\s*(Can\'t locate \S+ in \@INC)/
573 0 0 116 $ref && $ref->{'meth'}
602 6 0 6 length $_ and not m[/$]
621 8 5 12 length $_ and not m[/$]
634 0 1 71 $fill and scalar keys %$fill
682 2 1 3 $form_name and ref $hash_val
1 1 2 $form_name and ref $hash_val and scalar keys %$hash_val
691 0 0 0 $form_name and ref $hash_val
0 0 0 $form_name and ref $hash_val and scalar keys %$hash_val
727 12 0 0 $self->run_hook("validate_when_data", $step) and my(@keys) = keys %{{} unless $self->run_hook("hash_validation", $step);}
732 0 3 9 $ENV{'REQUEST_METHOD'} && $ENV{'REQUEST_METHOD'} eq 'POST'
771 1 0 7 ref $hash and scalar keys %$hash
807 111 1 4 @_ == 1 and !defined($_[0]) || ref $_[0] || $_[0] =~ /^[01]$/
846 1 0 3 $resp && $data

or 2 conditions

line l !l condition
65 74 79 $self->{'_recurse'} || 0
68 0 2 $self->{'jumps'} || 0
74 44 104 $self->{'path_i'} ||= 0
132 18 70 $self->path_info || (return)
155 20 11 $self->{'_level'} || 0
205 72 1 $self->run_hook('hash_form', $step) || {}
206 72 1 $self->run_hook('hash_base', $step) || {}
207 72 1 $self->run_hook('hash_common', $step) || {}
208 71 1 $self->run_hook('hash_swap', $step) || {}
209 71 1 $self->run_hook('hash_fill', $step) || {}
210 71 1 $self->run_hook('hash_errors', $step) || {}
257 442 77 $_[0]{'history'} ||= []
265 15 9 $_[0]{'stash'} ||= {}
298 2 79 $_[0]{'base_dir_abs'} || ['.']
299 2 16 $_[0]{'base_dir_rel'} || ''
302 3 2 $_[0]{'ext_conf'} || 'pl'
303 2 4 $_[0]{'ext_print'} || 'html'
304 2 8 $_[0]{'ext_val'} || 'val'
345 4 6 $_[0]{'path_i'} || 0
359 2 1 $_[0]{'path_i'} || 0
403 0 24 $row->{'level'} || 0
434 26 31 $self->{'path_i'} || 0
445 8 12 $self->{'path_i'} || 0
474 8 12 $self->{'jumps'} || 0
477 1 19 $self->{'_morph_lineage'} || []
500 132 1 shift() || (return)
501 21 111 shift() || $self->run_hook('allow_morph', $step) || (return)
503 4 17 $self->{'_morph_lineage'} ||= []
549 9 22 $self->{'path_i'} || 0
556 1 2 $self->{'path'} ||= []
563 37 8 shift() || 0
571 111 5 shift() || '_no_step'
572 116 0 $self->history->[-1] || {}
576 19 97 $self->{'_morph_lineage'} || (return)
609 9 1 $self->val_path || []
635 0 71 $self->run_hook('fill_args', $step) || {}
645 7 71 $self->{'hash_base'} ||= {"script_name", $self->script_name, "path_info", $self->path_info}
658 7 54 $_[0]{'hash_common'} ||= {}
659 12 70 $_[0]{'hash_errors'} ||= {}
660 6 66 $_[0]{'hash_fill'} ||= {}
662 6 66 $_[0]{'hash_swap'} ||= {}
708 1 1 $step || ''
713 24 4 $_[0]{'path_i'} || 0
738 1 26 $self->run_hook('next_step', $step) || (return 0)
763 0 72 $self->run_hook('template_args', $step) || {}
808 11 105 $self->{'require_auth'} || 0
837 0 11 $args->{'get_pass_by_user'} ||= sub { my($auth, $user) = @_; $self->get_pass_by_user($user, $auth); }
838 0 11 $args->{'verify_user'} ||= sub { my($auth, $user) = @_; $self->verify_user($user, $auth); }
839 0 11 $args->{'cleanup_user'} ||= sub { my($auth, $user) = @_; $self->cleanup_user($user, $auth); }

or 3 conditions

line l !l&&r !l&&!r condition
18 194 2 0 shift() || croak('Missing class name')
52 0 8 11 ref $err || $err ne "Long Jump\n"
58 1 75 0 $self->{'_no_post_navigate'} || eval { do { $self->post_navigate; 1 } }
106 249 80 0 $self->{'path'} ||= do { my @path; $self->parse_path_info("path_info_map_base", $self->path_info_map_base); my $step = $self->form->{$self->step_key}; if (defined $step) { $step =~ s[^/+][]; $step =~ s[/][__]g; if ($step =~ /^_/) { $self->stash->{'forbidden_step'} = $step; push @path, $self->forbidden_step; } elsif ($self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step) { $self->stash->{'forbidden_step'} = $step; push @path, $self->forbidden_step; } else { push @path, $step; } ; } ; \@path }
132 0 37 51 $info ||= $self->path_info || (return)
137 0 6 0 $form ||= $self->form
261 2 28 143 $_[0]{'path_info'} or $ENV{'PATH_INFO'}
264 7 80 29 $_[0]{'script_name'} or $ENV{'SCRIPT_NAME'}
275 1 0 3 $self->{'conf_obj'} || do { my $args = $self->conf_args || {}; $args->{'paths'} ||= $self->conf_path; $args->{'directive'} ||= 'MERGE'; require CGI::Ex::Conf; 'CGI::Ex::Conf'->new($args) }
286 1 0 14 $self->{'val_obj'} || do { my $args = $self->val_args || {}; $args->{'cgix'} ||= $self->cgix; require CGI::Ex::Validate; 'CGI::Ex::Validate'->new($args) }
300 13 1 0 @_ == 2 ? $_[0]{'cgix'} = pop() : $_[0]{'cgix'} ||= do { require CGI::Ex; "CGI::Ex"->new }
301 3 0 0 @_ == 2 ? $_[0]{'cookies'} = pop() : $_[0]{'cookies'} ||= $_[0]->cgix->get_cookies
305 7 4 0 @_ == 2 ? $_[0]{'form'} = pop() : $_[0]{'form'} ||= $_[0]->cgix->get_form
311 4 4 0 $self->{'conf'} ||= do { my $conf = $self->conf_file; $conf = $self->conf_obj->read($conf, {'no_warn_on_fail', 1}) || ($self->conf_die_on_fail ? croak($@) : {}) unless ref $conf; my $hash = $self->conf_validation; if ($hash and scalar keys %$hash) { my $err_obj = $self->val_obj->validate($conf, $hash); croak("$err_obj") if $err_obj; } ; $conf }
313 0 0 1 $self->conf_obj->read($conf, {'no_warn_on_fail', 1}) || ($self->conf_die_on_fail ? croak($@) : {})
327 6 4 0 $self->{'conf_file'} ||= do { my $module = $self->name_module || croak('Missing name_module during conf_file call'); $module . "." . $self->ext_conf }
328 3 1 0 $self->name_module || croak('Missing name_module during conf_file call')
398 3 3 27 not ref $row or ref $row ne "HASH"
6 3 24 not ref $row or ref $row ne "HASH" or not exists $row->{'elapsed'}
497 76 39 18 not $ref && $ref->{'meth'} or $ref->{'meth'} ne "morph"
510 3 17 0 $new ||= $self->run_hook("morph_package", $step)
523 12 0 6 UNIVERSAL::can($new, "fixup_after_morph") or eval { do { require $file } } and UNIVERSAL::can($new, "fixup_after_morph")
573 0 114 2 not $ref && $ref->{'meth'} or $ref->{'meth'} ne "unmorph"
578 19 0 0 pop @$lin || croak("unmorph called more times than morph (current: $cur)")
599 6 1 0 $self->run_hook('name_step', $step) || croak('Missing name_step')
616 8 1 0 $self->run_hook('name_step', $step) || croak('Missing name_step')
666 1 1 0 $self->{'hash_validation'}{$step} ||= do { my $file = $self->run_hook("file_val", $step); $file ? $self->val_obj->get_validation($file) : {} }
680 3 1 2 $_[2] || $self->run_hook('form_name', $step)
681 2 1 3 $_[3] || $self->run_hook('hash_validation', $step)
688 0 0 0 $_[2] || $self->run_hook('form_name', $step)
700 19 1 0 $step || croak('Missing step')
708 3 18 0 $self->{'name_module'} ||= $self->script_name =~ / (\w+) (?:\.\w+)? $/x ? $1 : die("Could not determine module name from \"name_module\" lookup (" . ($step || '') . ")\n")
764 0 72 0 $args->{'include_path'} || $self->template_path
0 72 0 $args->{'INCLUDE_PATH'} ||= $args->{'include_path'} || $self->template_path
807 1 4 0 !defined($_[0]) || ref $_[0] || $_[0] =~ /^[01]$/
831 0 11 0 $args->{'script_name'} ||= $self->script_name
832 0 0 11 $args->{'path_info'} ||= $self->path_info
833 0 11 0 $args->{'cgix'} ||= $self->cgix
834 0 11 0 $args->{'form'} ||= $self->form
835 0 11 0 $args->{'cookies'} ||= $self->cookies
836 0 11 0 $args->{'js_uri_path'} ||= $self->js_uri_path
855 1 1 1 $self->form->{'js'} || $self->path_info