Branch Coverage

blib/lib/CGI/Application.pm
Criterion Covered Total %
branch 158 186 84.9


line true false branch
28 0 69 if (ref $class)
48 1 68 if (ref $args[0] eq 'HASH') { }
55 4 65 if (exists $$rprops{'TMPL_PATH'})
60 20 49 if (exists $$rprops{'QUERY'})
65 2 67 if (exists $$rprops{'PARAMS'})
66 1 1 unless ref $$rprops{'PARAMS'} eq 'HASH'
93 4 57 if (ref $rm_param eq 'CODE') { }
4 53 elsif (ref $rm_param eq 'HASH') { }
107 26 35 unless defined $rm and length $rm
121 58 3 if (exists $rmodes{$rm}) { }
126 1 2 unless (exists $rmodes{'AUTOLOAD'})
144 2 58 $is_autoload ? :
146 3 57 if ($@)
149 2 1 if (my $em = $self->error_mode) { }
158 57 1 defined $body ? :
186 1 60 if (length $prerun_mode)
195 7 51 if ref $body eq 'SCALAR'
201 1 57 if ($$self{'__IS_PSGI'}) { }
204 0 1 if (ref $body eq 'GLOB' or &Scalar::Util::blessed($body) and $body->can('getline')) { }
0 1 elsif (ref $body eq 'CODE') { }
230 4 53 unless $ENV{'CGI_APP_RETURN_ONLY'}
247 0 0 unless (defined $$args_to_new{'QUERY'})
331 1 1 unless defined $current_runmode
425 48 24 unless exists $$self{'__HEADER_PROPS'}
430 19 53 if (scalar @data)
431 1 18 if ($self->header_type eq 'none')
435 4 15 if (ref $data[0] eq 'HASH') { }
13 2 elsif (scalar(@data) % 2 == 0) { }
442 1 1 $in{'add'} ? :
447 4 13 if ($in{'add'}) { }
450 1 1 unless defined $existing_val
451 0 1 ref $existing_val eq 'ARRAY' ? :
475 69 88 unless exists $$self{'__HEADER_TYPE'}
478 80 77 if (defined $header_type)
481 0 80 unless grep {$_ eq $header_type;} @allowed_header_types
495 24 82 unless exists $$self{'__PARAMS'}
500 98 8 if (scalar @data) { }
502 1 97 if (ref $data[0] eq 'HASH') { }
62 35 elsif (scalar(@data) % 2 == 0) { }
0 35 elsif (scalar @data > 1) { }
517 96 2 if (scalar @data <= 2)
530 1 2 unless defined $param
542 44 203 if (defined $query) { }
546 15 188 unless (exists $$self{'__QUERY_OBJ'})
560 63 68 unless exists $$self{'__RUN_MODES'}
565 70 61 if (scalar @data)
567 1 69 if (ref $data[0] eq 'HASH') { }
12 57 elsif (ref $data[0] eq 'ARRAY') { }
56 1 elsif (scalar(@data) % 2 == 0) { }
593 69 76 unless exists $$self{'__START_MODE'}
596 119 26 if (defined $start_mode)
609 3 2 unless exists $$self{'__ERROR_MODE'}
612 2 3 if (defined $error_mode)
625 6 7 unless exists $$self{'__TMPL_PATH'}
628 5 8 if (defined $tmpl_path)
642 56 8 unless exists $$self{'__PRERUN_MODE'}
645 3 61 if (defined $prerun_mode)
647 2 1 if (exists $$self{'__PRERUN_MODE_LOCKED'}) { }
684 6 0 $type eq 'none' ? :
47 6 $type eq 'header' ? :
4 53 $type eq 'redirect' ? :
697 0 0 $type eq 'none' ? :
1 0 $type eq 'header' ? :
0 1 $type eq 'redirect' ? :
1854 6 1 unless exists $$self{'__HTML_TMPL_CLASS'}
1856 0 7 if (defined $tmpl_class)
1868 6 1 if (my $tmpl_path = $self->tmpl_path)
1869 1 5 ref $tmpl_path eq 'ARRAY' ? :
1872 0 2 if ($extra_params[$x] eq 'path' and ref $extra_params[$x + 1] eq 'ARRAY')
1879 6 0 unless $found
1884 1 6 unless keys %ht_params
1887 6 1 unless defined $$self{'__CURRENT_TMPL_EXTENSION'}
1890 0 7 unless (defined $tmpl_file)
1897 0 7 unless eval "require $ht_class;"
1903 0 7 if (ref $tmpl_file eq 'SCALAR') { }
0 7 elsif (ref $tmpl_file eq 'GLOB') { }
1911 1 6 if (keys %tmpl_params)
2008 69 103 unless exists $$self{'__MODE_PARAM'}
2012 104 68 if (scalar @_ == 1) { }
2017 0 68 unless @_ % 2 == 0
2022 4 64 if ($p{'path_info'} and $self->query->path_info)
2030 3 1 if $idx > 0
2038 4 0 length $pi ? :
2044 109 63 if (defined $mode_param and length $mode_param)
2352 0 44 unless $callback
2353 0 44 unless exists $INSTALLED_CALLBACKS{$hook}
2355 5 39 if (ref $c_or_class) { }
2419 0 261 unless exists $INSTALLED_CALLBACKS{$hook}
2425 0 5 if $executed_callback{$callback}
2428 0 5 if $@
2440 244 277 unless exists $INSTALLED_CALLBACKS{$hook}{$class}
2444 10 295 if $executed_callback{$callback}
2447 0 295 if $@