Branch Coverage

blib/lib/Waft.pm
Criterion Covered Total %
branch 194 398 48.7


line true false branch
6 23 0 eval { do { require warnings } } ? :
24 2 0 if (defined $mixins[0] and $mixins[0] eq 'with')
28 0 2 if @mixins == 0
35 4 4 if ($base =~ /\A :: /msx)
39 0 8 if $caller->isa($base)
43 1 7 if ($@)
44 0 1 unless $@ =~ /\ACan't locate .*? at \(eval /
46 0 1 unless (do { no strict 'refs'; %{"${base}::";} })
68 0 2 if $class->blessed
118 0 2 if $self->BCV < 1
120 1 1 unless defined wantarray
125 1 0 unless $self->responded
139 7 7 if $package ne $class and $self->isa($package)
141 6 2 if defined $_
3 4 unless (grep {length $_ >= 1 if defined $_;} @args)
167 0 1 if $class->blessed
169 0 1 if $using_utf8 and not $class->can_use_utf8
179 0 14 if ($self->BCV < 0.53)
180 0 0 if $self->blessed
195 1 0 unless $@
204 0 5 if ($self->BCV < 1)
221 0 4 if $class->blessed
232 31 10 if exists $Allow_template_file_exts_arrayref_of{$class}
241 1 9 $get_allowed_exts ? :
257 0 0 if $class->blessed
279 0 0 if ($self->BCV < 0.53)
280 0 0 unless ($self->blessed)
289 0 0 unless ($self->blessed)
295 0 0 wantarray ? :
301 0 18 if $class->blessed
307 2 16 if ($class->BCV < 1)
311 0 18 if ($class->BCV < 0.53)
322 0 0 if (ref $args[0] eq 'HASH') { }
336 0 0 if ($$stash{'use_utf8'})
340 0 0 wantarray ? :
376 0 3 if (defined $ENV{'REQUEST_URI'} and $ENV{'REQUEST_URI'} =~ /\A ([^?]+) /msx) { }
389 3 0 $url =~ m[ ([^/]+) \z]msx ? :
398 1 2 if eval { do { FindBin::again(); 1 } }
409 0 3 if ($self->BCV < 0.53)
436 2 3 $self->is_submitted ? :
439 1 4 if ($self->get_using_utf8 and defined $page)
444 3 2 defined $page ? :
470 2 2 if ($self->get_using_utf8)
475 0 2 if ($@) { }
0 2 elsif ($query->VERSION < 3.31) { }
489 2 3 unless defined $page
498 3 0 if defined $untainted_page and not 'File::Spec'->file_name_is_absolute($untainted_page) and not $untainted_page eq 'CURRENT' and not $untainted_page eq 'TEMPLATE' and not $self->to_page_id($untainted_page) =~ / __indirect \z/msx
535 1 3 unless defined $joined_values
546 0 6 if ($key eq 'ALL_VALUES')
575 6 6 wantarray ? :
590 2 1 defined $action ? :
598 1 2 unless $self->is_submitted
608 0 6 if ($self->BCV < 0.53)
609 0 0 if $action_id =~ /\A global_ /msx
612 0 6 if $action_id =~ /(?: \A | _ ) direct \z/msx or $action_id =~ /(?: \A | _ ) indirect \z/msx or $action_id =~ /\A global__ /msx
616 0 6 if $self->can("__${page_id}__$action_id")
618 0 6 if defined $global_action
620 0 6 if ($self->BCV < 0.53)
621 0 0 if ($self->can("global_$action_id"))
628 2 4 if ($self->can("global__$action_id"))
635 2 0 if defined $global_action
637 0 0 if $self->can("__${page_id}__submit")
639 0 0 if ($self->BCV < 0.53)
640 0 0 if $self->can('global_submit')
643 0 0 if $self->can('global__submit')
682 0 3 if ($self->get_using_utf8) { }
696 0 5 if ($self->BCV < 0.53)
710 0 0 if $NEXT::SEEN and $Waft::Correct_NEXT_DISTINCT
712 0 0 if (my $coderef = $self->can('begin'))
720 0 0 if (my $coderef = $self->can('before'))
723 0 0 if $$stash{'responded'}
726 0 0 if (my $coderef = $self->find_action_method) { }
729 0 0 if $$stash{'responded'}
731 0 0 if ($self->BCV < 0.53)
732 0 0 if ($self->to_action_id($self->get_action) eq 'template')
735 0 0 if $$stash{'responded'}
747 0 0 if $$stash{'responded'}
750 0 0 if ++$forward_count >= 5
754 0 0 if ($self->can('end'))
757 0 0 if (@return_values)
762 0 0 wantarray ? :
770 0 0 wantarray ? :
0 1 if $self->stash->{'responded'}
776 0 1 if ($method_name eq 'begin' || $method_name eq 'before' and @return_values == 0)
784 0 1 ref $next eq 'HASH' ? :
0 1 ref $next eq 'ARRAY' ? :
789 1 0 unless (defined $next_page)
790 0 1 $method_name eq 'before' ? :
0 1 $method_name eq 'begin' ? :
795 1 0 unless (defined $next_action)
796 1 0 $next_page eq 'TEMPLATE' ? :
800 1 0 if ($next_page eq 'CURRENT' or $next_page eq 'TEMPLATE') { }
807 0 1 if ($next_page eq 'CURRENT' and $method_name eq 'begin' || $method_name eq 'before') { }
825 0 0 if ($self->BCV < 0.53)
826 0 0 if ($action_id eq 'direct') { }
0 0 elsif ($action_id eq 'indirect') { }
0 0 elsif ($action_id =~ /\A global_ /msx) { }
841 0 0 if ($action_id eq 'direct') { }
0 0 elsif ($action_id eq 'indirect') { }
0 0 elsif ($action_id =~ /\A global__ /msx) { }
865 0 1 if ($self->BCV < 0.53)
869 0 1 if ($page eq 'CURRENT' or $page eq 'TEMPLATE')
875 0 1 unless (defined $template_file)
894 0 1 if ($page eq 'CURRENT' or $page eq 'TEMPLATE')
898 0 1 if ('File::Spec'->file_name_is_absolute($page))
899 0 0 unless -f $page
918 3 22 if $Waft::Cache and exists $Cached_template_file{join $;, $class, $page}
924 5 17 unless defined $template_file
936 0 41 if $$seen{$class}++
943 39 0 $INC{$module_file} =~ m[\A (.+) /\Q$module_file\E \z]msx ? :
2 39 !defined($INC{$module_file}) ? :
949 22 19 if ($self->is_allowed_to_use_template_file_ext($page, $class))
957 17 71 if -f $template_file
966 9 10 if defined $template_file
975 0 41 if $self->BCV < 0.53
982 0 67 if (length $allow_template_file_ext == 0)
983 0 0 unless $page =~ / \. /msx
988 22 45 if $page =~ / \Q$allow_template_file_ext\E \z/msx
1001 0 1 unless (@stat)
1014 0 1 if $Waft::Cache and exists $Cached_template_coderef{$template_id}
1021 0 0 unless $cached_template_id =~ /$old_template_id_regexp/
1026 0 1 unless ($template_scalarref)
1047 0 1 unless sysopen my $file_handle = gensym, $template_file, 0
1062 1 1 if (ref $template eq 'SCALAR')
1107 0 2 $self->BCV < 1 ? :
1113 2 0 if (defined $template_class)
1117 2 0 if (defined $template_file)
1123 0 2 if $@
1131 0 0 if $form_block =~ / \b (?: output_waft_tags | (?: (?i) waft(?: \s+ | _ ) tag s? ) | form_elements # deprecated ) \b /msx
1174 5 0 if (defined $keys_arrayref_or_key and $keys_arrayref_or_key eq 'ALL_VALUES')
1180 5 0 if (ref $keys_arrayref_or_key eq 'ARRAY')
1183 0 12 unless (defined $key)
1188 0 12 unless exists $$value_hashref{$key}
1194 14 0 if defined $value
1209 0 0 if (defined $keys_arrayref_or_key) { }
1219 0 0 if (@keys_arrayref_or_key_value_pairs) { }
1223 0 0 if (not defined $value_or_values_arrayref) { }
0 0 elsif (ref $value_or_values_arrayref eq 'ARRAY') { }
1232 0 0 if defined $value
1267 0 1 unless $self->value_hashref->{$key}
1 12 if @i
1269 0 12 unless $self->value_hashref->{$key}
1280 12 12 wantarray ? :
1286 21 7 if ($text_part =~ / ([^\x0A\x0D]*) ( [\x0A\x0D] .* ) /msx)
1289 5 16 if (length $first_line > 0)
1316 23 0 if eval { do { require warnings } }
1347 1 1 if ($response_header =~ /\A Status: \s* (.*) /imsx)
1351 1 1 if ($response_header =~ /\A Content-Type: \s* (.*) /imsx)
1356 0 2 if ($self->BCV < 0.53)
1357 0 0 unless (defined $content_type)
1367 1 1 unless (defined $content_type)
1383 0 4 if $self->BCV < 0.53
1401 3 1 if @{$$stash{'contents'};} == 1
1404 1 3 if wantarray
1420 0 10 unless (defined $value)
1433 8 2 wantarray ? :
1441 0 10 unless (defined $value)
1454 8 2 wantarray ? :
1462 0 12 unless (defined $value)
1480 0 12 wantarray ? :
1488 0 45 unless (defined $value)
1501 17 28 wantarray ? :
1518 11 73 if not $Start{join $;, $ident, $method} or (caller $back + 1)[3] ne (caller 0)[3]
1530 0 84 unless $next_coderef
1574 0 0 unless (defined $page)
1600 3 1 if @_ == 1
1609 2 1 if @_ == 1
1620 0 2 if ($self->stash->{'responded'})
1626 2 0 if ($response_header =~ /\A ([^:]+) /msx)
1641 0 2 if ($$stash{'responded'})
1657 0 6 if ($_[0]->BCV < 0.53)
1673 0 6 if ($$stash{'responded'})
1695 8 1 if length $query_string == 0
1709 1 6 if (defined $ENV{'HTTP_HOST'}) { }
1715 2 4 if ($protocol eq 'http' and $ENV{'SERVER_PORT'} != 80 or $protocol eq 'https' and $ENV{'SERVER_PORT'} != 443)
1722 5 2 if (defined $ENV{'REQUEST_URI'} and $ENV{'REQUEST_URI'} =~ /\A ([^?]+) /msx) { }
1731 0 7 if $self->BCV < 0.53
1742 0 9 if (ref $page eq 'ARRAY')
1746 0 1 $page eq 'CURRENT' ? :
8 1 !defined($page) ? :
1752 1 8 if ($page ne 'default.html')
1758 1 8 if ($joined_values)
1775 0 4 unless (defined $value)
1781 0 4 if ($using_utf8)
1789 2 0 wantarray ? :
1795 0 9 if defined $Waft::Base_url and $self->BCV < 1
1797 0 9 if $self->BCV < 0.53
1876 0 2 if $Defined_subs_for_under_0_99x
1915 0 0 if $Defined_subs_for_under_0_52x
1920 0 0 if (@values)
1934 0 0 if ref $arrayref eq 'ARRAY'
1948 0 0 if (@args == 1 and defined $args[0] and $args[0] eq 'ALL' || $args[0] eq 'ALLVALUES')
1996 0 3 if (ref $_[2] eq 'ARRAY') { }
1997 0 0 defined $_[1] ? :
2000 3 0 defined $_[1] ? :
2011 6 0 defined $_[1] ? :
0 6 unless my $arrayref = $_[0]{defined $_[1] ? $_[1] : warn_and_null()}
2021 0 0 defined $_[1] ? :
2023 0 0 defined $_[1] ? :