Branch Coverage

blib/lib/WebDyne.pm
Criterion Covered Total %
branch 142 402 35.3


line true false branch
21 2 0 unless eval 'use Time::HiRes qw(time)'
154 0 10 if $WebDyne::WEBDYNE_WARNINGS_FATAL
166 0 10 if ($r->header_only)
243 0 10 if ($WebDyne::WEBDYNE_CACHE_DN) { }
255 10 0 if ($WebDyne::WEBDYNE_RELOAD or $self->{'_compile'} or $cache_inode_hr->{'mtime'} < $srce_mtime or $cache_mtime > $cache_inode_hr->{'mtime'}) { }
267 0 10 if ($WebDyne::WEBDYNE_RELOAD)
269 0 0 unless ($INC{'Module/Reload.pm'})
272 0 0 if $@
291 10 0 unless (eval { do { require Symbol; &Symbol::delete_package("WebDyne::$srce_inode") } })
292 0 10 if $@
308 10 0 if ($self->{'_compile'} or $cache_mtime < $srce_mtime) { }
318 0 10 unless eval { do { require WebDyne::Compile } }
336 0 10 if errstr()
344 0 10 if $cache_pn
370 0 0 if (my $meta_hr = $container_ar->[0])
371 0 0 if (my $perl_ar = $meta_hr->{'perl'})
374 0 0 unless $self->perl_init($perl_ar, $perl_debug_ar)
382 0 10 if (my $meta_hr = $container_ar->[0] and $cache_inode_hr->{'meta'}) { }
10 0 elsif ($meta_hr) { }
406 10 0 if (my $cgi_or = $self->{'_CGI'} and $WebDyne::WEBDYNE_CGI_PARAM_EXPAND)
427 0 10 if (my $handler_ar = $meta_hr->{'handler'} || $r->dir_config('WebDyneHandler'))
428 0 0 ref $handler_ar ? :
429 0 0 if (ref $self ne $handler)
431 0 0 unless ($Package{'_handler_load'}{$handler})
435 0 0 unless eval { do { require $handler_fn } }
437 0 0 unless UNIVERSAL::can($handler, 'handler')
459 0 10 if (my $cache = $self->{'_cache'} || $meta_hr->{'cache'} and not $self->{'_cache_run_fg'}++)
463 0 0 if (ref $cache eq 'CODE') { }
469 0 0 unless &$eval_cr($self, undef, \%param, q[$_[1]->{'cache_cr'}->($_[0], $_[1]->{'srce_inode'})], 0)
478 0 0 unless &$eval_cr($self, undef, $srce_inode, $cache, 0)
485 0 0 $cache_inode ? :
493 0 0 if ($cache_inode ne $srce_inode or $self->{'_compile'})
511 1 9 if ($self->{'_static'} or $meta_hr and $meta_hr->{'html'} || $meta_hr->{'static'})
514 0 1 if ($cache_pn and -f (my $fn = "$cache_pn.html") and (stat _)[9] >= $srce_mtime and not $self->{'_compile'}) { }
0 1 elsif ($cache_pn) { }
520 0 0 if ($WebDyne::MP2 or $ENV{'FCGI_ROLE'}) { }
552 0 0 $meta_hr->{'static'} || $self->{'_static'} ? :
554 0 0 $WebDyne::MP2 ? :
564 0 1 $meta_hr->{'static'} || $self->{'_static'} ? :
566 0 1 $WebDyne::MP2 ? :
587 0 10 unless tie *WEBDYNE, 'WebDyne::TieHandle', $self
589 10 0 if $select
617 10 0 if $select
625 0 10 if errstr()
626 0 10 if &CGI::cgi_error()
633 1 9 if (my $block_param_hr = delete $self->{'_block_param'})
636 0 4 unless (exists $self->{'_block_render'}{$block_name})
640 0 1 if (@block_error)
650 0 10 unless $r->status
681 10 0 unless $WebDyne::MP2
687 0 10 $WebDyne::MP2 ? :
700 0 10 if ($WebDyne::WEBDYNE_CACHE_CHECK_FREQ and $r eq ($r->main || $r) and not +(my $nrun = ++$Package{'_nrun'}) % $WebDyne::WEBDYNE_CACHE_CHECK_FREQ) { }
10 0 elsif ($WebDyne::WEBDYNE_CACHE_CHECK_FREQ) { }
716 0 0 $WebDyne::MP2 ? :
788 0 2 if ($WebDyne::MP2) { }
0 2 elsif ($ENV{'MOD_PERL'}) { }
798 0 1 unless eval { do { require Apache::Log; require Apache::Response; require Apache::SubRequest; require Apache::Const; 'Apache::Const'->import('-compile', ('OK', 'DECLINED')); require APR::Table } }
805 0 0 if $@
806 0 0 unless (UNIVERSAL::can('Apache', 'OK'))
807 0 0 if (UNIVERSAL::can('Apache2::Const', 'OK')) { }
0 0 elsif (UNIVERSAL::can('Apache::Const', 'OK')) { }
817 0 0 unless defined &Apache::OK
819 0 0 unless defined &Apache::DECLINED
830 0 0 unless (eval { do { require Apache::Constants; 'Apache::Constants'->import('OK', 'DECLINED'); *Apache::OK = \&Apache::Constants::OK; *Apache::DECLINED = \&Apache::Constants::DECLINED } })
833 0 0 if $@
845 0 2 if ($WebDyne::WEBDYNE_STARTUP_CACHE_FLUSH and -d $WebDyne::WEBDYNE_CACHE_DN)
867 2 0 if ('CGI'->can('_tag_func')) { }
872 10 8 unless 'CGI'->can($tag)
876 20 16 unless 'CGI'->can($start_end_function)
960 0 43 unless &eval_cr($inode, \$eval_text, $html_line_no)
980 0 43 if (not @eval or $@ or not $eval[0])
984 0 0 if (errstr() or $@) { }
988 0 0 $@ ? :
1064 0 0 if (not defined $html_sr or $@)
1069 0 0 if (errstr() or $@) { }
1073 0 0 $@ ? :
1089 0 0 if (ref $html_sr eq 'ARRAY')
1090 0 0 ref $_ ? :
1096 0 0 if (my $print_ar = delete $self->{'_print_ar'}{$data_ar})
1097 0 0 ref $_ eq 'SCALAR' ? :
1098 0 0 ref $html_sr ? :
1104 0 0 ref $html_sr ? :
1117 0 1 unless &$eval_cr(@_)
1150 4 33 if (ref $html_sr eq 'ARRAY' and not $tag_fg)
1158 3 34 if (my $print_ar = delete $self->{'_print_ar'}{$data_ar})
1159 0 3 ref $_ eq 'SCALAR' ? :
1160 3 0 ref $html_sr ? :
1165 30 7 ref $html_sr ? :
1175 1 25 unless ($value)
1176 0 0 if (not exists $_[2]{$_[3]} and $WebDyne::WEBDYNE_STRICT_VARS)
1182 0 26 if (ref $value and overload::Overloaded($value))
1183 2 24 ref $value ? :
1201 0 0 UNIVERSAL::can($r, $m) ? :
1226 0 0 $WebDyne::WEBDYNE_CACHE_CLEAN_METHOD ? :
1238 0 0 if (@cache > $WebDyne::WEBDYNE_CACHE_HIGH_WATER) { }
1290 0 0 unless $WebDyne::MP2
1303 0 0 $data_ar ? :
1319 33 10 if $param_hr
1342 0 43 if $param_hr->{'block'}
1394 18 59 if ($data_ar->[$WebDyne::WEBDYNE_NODE_SBST_IX])
1402 0 77 if $attr_hr->{'param'}
1408 37 40 if (not $WebDyne::CGI_TAG_WEBDYNE{$html_tag} or $html_tag eq 'subst') { }
1414 21 16 $data_ar->[$WebDyne::WEBDYNE_NODE_CHLD_IX] ? :
1426 2 35 if (ref $data_chld_ar) { }
1432 0 2 unless &$render_cr($render_cr, $self, $cgi_or, $data_chld_ar, $param_data_hr)
1466 56 21 if ($WebDyne::CGI_TAG_WEBDYNE{$html_tag}) { }
21 0 elsif ($attr_hr) { }
0 0 elsif ($html_chld) { }
1549 75 79 if (ref $data_ar) { }
1555 0 75 unless &$render_cr($render_cr, $self, $cgi_or, $data_ar, $param_data_hr)
1595 0 0 if (my $select = $self->{'_select'})
1603 0 0 if ($param_hr->{'uri'} or $param_hr->{'file'} or $param_hr->{'location'}) { }
1618 0 0 if (my $errstr = errstr()) { }
0 0 elsif (&is_error($status)) { }
0 0 elsif ($status != &Apache::OK and not &is_success($status) and not &is_redirect($status)) { }
1648 0 0 if ($param_hr->{'html'}) { }
0 0 elsif ($param_hr->{'text'}) { }
1659 0 0 ref $html_sr ? :
1665 0 0 unless $WebDyne::MP2
1671 0 0 ref $html_sr ? :
1696 0 0 unless $self->$_
1703 0 0 if (my $location = $param_hr->{'location'})
1708 0 0 if (UNIVERSAL::can($r, 'redirect')) { }
1727 0 0 unless $WebDyne::MP2
1732 0 0 if (my $uri = $param_hr->{'uri'}) { }
0 0 elsif (my $file = $param_hr->{'file'}) { }
1736 0 0 if (UNIVERSAL::can($r, 'internal_redirect')) { }
1799 0 0 if ($status and not &is_success($status) or my $errstr = errstr())
1800 0 0 if ($errstr) { }
1842 0 0 ref($r_child) =~ /^WebDyne::/ ? :
0 0 unless defined($status = ref($r_child) =~ /^WebDyne::/ ? $r_child->run($self) : $r_child->run)
1867 0 0 unless ref $param_hr
1900 4 0 unless ref $param_hr
1939 0 4 if (exists $self->{'_block_cache'}{$name}) { }
2020 1 3 unless (@data_block_ar)
2070 3 0 if (@html_sr) { }
2076 1 2 $#html_sr ? :
2122 4 7 if (exists $self->{'_block_render'}{$name}{$data_ar}) { }
3 4 elsif (exists $self->{'_block_param'}{$name}) { }
1 3 elsif ($attr_hr->{'display'}) { }
2231 6 20 if (my $perl_code = $attr_hr->{'perl'}) { }
2275 0 20 unless $method
2283 0 20 if $package
2285 0 20 if ($package and not $INC{$package_fn})
2291 0 0 unless eval { do { require $package_fn } }
2336 0 20 unless (ref $html_sr eq 'SCALAR')
2400 0 9 if $Package{'_cache'}{$inode}{'perl_init'}{$perl_sr}++
2411 0 9 if ($WebDyne::WEBDYNE_EVAL_SAFE) { }
2428 0 0 unless ($safe_or->reval(${$perl_sr;}, $WebDyne::WEBDYNE_EVAL_USE_STRICT))
2433 0 0 if ($@ or errstr())
2457 0 0 $@ ? :
2545 0 19 unless ref $sr eq 'SCALAR'
2549 0 19 unless &$cr($1, $3, $index++)
2593 0 27 if $attr_name eq 'perl'
2600 16 11 if ($attr_value =~ /^\s*([\@%!+*^]){1}{(\1?)(.*)\2}\s*$/so or $attr_value =~ /^\s*(\$){1}{(\1?)([^{]+)\2}\s*$/so) { }
2608 5 11 ref $eval eq 'SCALAR' ? :
2619 0 10 unless ref $sr eq 'SCALAR'
2623 0 10 unless &$cr($1, $3, $index++)
2662 3 2 if (ref $_[0] eq 'ARRAY') { }
2673 0 2 unless ref $param_hr
2699 2 3 if (my $node = (grep {exists $param_hr->{$_};} 'head', 'body')[0]) { }
2 1 elsif (my $block = $param_hr->{'block'}) { }
2732 0 2 unless @{$block_ar;}
2744 0 2 unless $self->optimise_one($block_ar)
2745 0 2 unless $self->optimise_two($block_ar)
2758 2 0 if $data_ar
2800 0 2 unless @{$block_ar;}
2818 0 2 if $data_ar
2881 26 61 if ((my $data_ar_tag = $data_ar->[$WebDyne::WEBDYNE_NODE_NAME_IX]) eq $tag) { }
2896 25 1 if (grep({$tag_attr_hr->{$_} eq $attr_hr->{$_};} keys %{$tag_attr_hr;}) == keys %{$attr_hr;})
2909 0 25 $prnt_fg ? :
2910 18 7 unless $all_fg
2925 0 69 if $depth_max and ++$depth > $depth_max
2930 64 5 $data_ar->[$WebDyne::WEBDYNE_NODE_CHLD_IX] ? :
2937 51 29 if (ref $data_child_ar)
2942 21 30 if (my $data_match_ar = &$find_cr($find_cr, $data_child_ar, $data_ar))
2947 21 0 unless $all_fg
3007 0 0 if ($data_chld_ar eq $node_ar) { }
3022 0 0 unless &$find_cr($find_cr, $data_chld_ar)
0 0 if ${return err() unless &$find_cr($find_cr, $data_chld_ar);}
3080 10 0 if $WebDyne::WEBDYNE_CGI_PARAM_EXPAND
3119 0 5 @_ ? :
3132 0 0 $WebDyne::WEBDYNE_DUMP_FLAG || $attr_hr->{'force'} || $attr_hr->{'display'} ? :
3163 0 0 unless $self->cache_filename(@_)
3164 0 0 if $inode_pn
3174 0 0 @_ ? :
3175 0 0 if $WebDyne::WEBDYNE_CACHE_DN
3186 0 0 if @_
3206 0 0 if ($html_sr)
3225 0 0 if @_
3253 0 0 if (@param == 2) { }
0 0 elsif (@param) { }
3311 0 0 if @_
3334 0 0 @_ ? :
3355 0 0 if ($data_ar ||= $self->data_ar)
3368 0 0 if ($data_ar ||= $self->data_ar)
3369 0 0 wantarray ? :
3407 10 0 if $self->{'_CGI'}
3449 0 0 if $caller{$caller}++
3451 0 0 if (my $cr = UNIVERSAL::can($caller, $method))
3454 0 0 if ($WebDyne::WEBDYNE_AUTOLOAD_POLLUTE)