Branch Coverage

blib/lib/Apache/ASP.pm
Criterion Covered Total %
branch 317 568 55.8


line true false branch
160 40 8 if ref $package
165 0 48 unless ($filename = eval { do { $r->filename } })
166 0 0 $Apache::ASP::ModPerl2 ? :
167 0 0 if ($filename = eval { do { $rtest->filename } }) { }
177 0 48 if not -e $filename or -d _
192 48 0 unless $$self{'errs'}
197 7 41 if $$self{'dbg'}
200 0 48 if ($$self{'errs'})
208 0 48 if ($status != 500 and defined $$response{'Status'} and $$response{'Status'} != 302)
228 48 0 if ($$self{'filter'} or $status == 500 or $r->isa('Apache::ASP::CGI'))
232 48 0 if ($status eq '200')
240 0 0 if ref $_[0] or $_[0] eq 'Apache::ASP'
246 0 69 unless $r
252 1 68 if ($Apache::ASP::QuickStartTime) { }
265 0 69 unless chdir $dirname
280 0 69 $^O eq 'MSWin32' ? :
304 9 60 if ($$self{'dbg'}) { }
305 0 9 if ($$self{'dbg'} < 0) { }
319 46 23 unless ($Apache::ASP::SrandPid and $Apache::ASP::SrandPid == $$)
320 8 38 if $$self{'dbg'}
327 0 69 if ($filter_config)
328 0 0 if ($self->LoadModules('Filter', 'Apache::Filter')) { }
330 0 0 if ($r->can('filter_register'))
334 0 0 if ($r->can('filter_input') and $r->can('get_handlers'))
342 0 0 if (not $r->can('get_handlers')) { }
354 0 69 if ($compressgzip_config)
355 0 0 if ($self->LoadModule('Gzip', 'Compress::Zlib'))
362 28 41 unless ($$self{'global'} =~ /^(\.|\.\.)$/)
363 0 28 unless -d $$self{'global'}
368 2 67 if ($filename =~ m(^((/|[a-zA-Z]:).*[/\\])[^/\\]+?$)) { }
399 1 68 if (&config($self, 'UniquePackages')) { }
418 28 41 unless (&get_dir_config($dir_config, 'NoState'))
431 67 68 unless $$self{'destroy'}
432 8 60 if $$self{'dbg'}
436 0 0 if $$self{'dbg'}
438 0 0 if $@
443 65 3 if tied *RESPONSE
447 0 68 if tied *STDIN
451 28 40 if ($$self{'Session'})
452 28 0 if (eval { do { $$self{'Session'}->isa('Apache::ASP::Session') } }) { }
470 120 84 unless defined $$self{$_}
472 0 84 unless $tied
477 1 67 if (my $caches = $$self{'Caches'})
480 1 0 if ($$self{'cache_size'} =~ /^([\d\.]+)(M|K|B)?$/)
482 0 1 if ($unit eq 'M') { }
1 0 elsif ($unit eq 'K') { }
487 1 0 if ($size ne $$self{'cache_size'})
488 0 1 if $$self{'dbg'}
494 1 0 if ($$tied{'writes'} and $tied->Size > $$self{'cache_size'}) { }
495 0 1 if $$self{'dbg'}
498 0 0 if $$self{'dbg'}
505 68 0 if $$self{'Request'}
506 68 0 if $$self{'Server'}
507 68 0 if $$self{'Response'}
516 0 79 if ($Apache::ASP::ModPerl2) { }
533 2 44 unless ($share_path =~ /$Apache::ASP::AbsoluteFileMatch/)
547 0 46 unless -d $share_path
562 0 46 unless -d $lib_path
577 0 160 unless $file
581 69 91 unless ($$self{'compile_checksum'})
583 696 63 unless &config($self, $_)
593 69 91 $no_compile_checksum ? :
596 1 159 if ($$self{'inode_names'})
599 0 0 unless ($inode_stat[0] or $inode_stat[1])
604 1 159 if (@inode_stat) { }
608 1 158 if ($abs_file)
614 9 150 if ($file_name_length >= 35) { }
637 0 96 unless $file
639 20 76 if $$self{'dbg'}
641 22 74 if (ref $file) { }
74 0 elsif (length $file < 1024 and not $file =~ /^GLOB/ and -e $file) { }
642 22 0 if ($file =~ /SCALAR/) { }
0 0 elsif ($file =~ /GLOB/) { }
650 13 61 if $$self{'dbg'}
660 50 46 unless ($$self{'parse_config'})
669 10 40 if ($$self{'xml_subs_match'} = &config($self, 'XMLSubsMatch'))
676 0 50 unless ($Apache::ASP::ScriptLanguages{$lang})
688 0 50 if ($@)
695 85 11 if (&config($self, 'CgiDoSelf'))
700 96 0 if ($$self{'pod_comments'})
706 0 96 if ($$self{'compile_includes'} and $$self{'GlobalASA'}{'exists'})
734 10 0 unless ($$self{'compile_includes'})
737 4 6 unless ($line1_added)
739 4 0 $file_exists ? :
742 8 2 if ($head_data =~ s/.*\n\#line (\d+) ([^\n]+)\n(\%\>)?//s)
745 4 4 $3 ? :
754 0 10 if ($code_block < 0)
765 0 10 if ($has_args)
772 0 10 unless (defined $include)
776 0 10 if ($$self{'dbg'})
777 0 0 if ($include ne $file)
778 0 0 if $$self{'dbg'}
783 0 10 if (defined $args or $$self{'compile_includes'}) { }
789 0 0 if $$self{'dbg'}
794 0 0 unless ($self->CompileInclude($include))
798 0 10 if $$self{'dbg'}
801 0 10 if ($Apache::ASP::includes{$include}++ > 100)
812 10 0 if ($file_exists and $parse_file)
814 0 10 if $$self{'dbg'}
821 5 5 if ($text =~ /\n/s) { }
822 3 2 $code_block ? :
823 3 2 $code_block ? :
824 5 0 $file_context ? :
843 96 0 unless ($$self{'compile_includes'})
845 4 92 if (%Apache::ASP::includes and $$self{'pod_comments'})
848 92 4 if ($$self{'GlobalASA'}{'exists'})
864 87 9 if ($script) { }
865 40 47 $$self{'use_strict'} ? :
866 65 22 $file_exists ? :
888 15 86 if ($$self{'xml_subs_match'})
890 4 11 if $$self{'dbg'}
901 9 92 if $check_static_file and not $$data =~ /\<\%.*?\%\>/s
911 20 236 $perl =~ /^\s*\=(.*)$/so ? :
917 132 124 if ($text)
922 73 59 if ($last_perl_block)
929 256 0 if ($perl)
930 20 236 if (not $perl_block) { }
935 142 94 if (@out)
952 168 68 unless ($perl =~ /\n\s*$/so)
953 0 168 if ($perl =~ /\#[^\n]*$/so)
960 144 92 unless ($perl eq ';;;')
976 15 0 unless ($$self{'xslt'})
986 24 0 if $args
994 15 10 unless $data =~ s[ \<\s*($$self{'xml_subs_match'})(\s+[^\>]*)?\>(?!.*?\<\s*\1[^\>]*\>)(.*?)\<\/\1\s*> ][{ my($func, $args, $text) = ($1, $2, $3); $args = &CodeTagDecode($self, $args); $func =~ s/\:+/::/g; $args = &ParseXMLSubsArgs($self, $args) if $args; $args ||= ''; ++$$self{'xmlsubs_compiled_tag_long'}; $text = &CodeTagDecode($self, $text); if ($text =~ /\<\%|\<($$self{'xml_subs_match'})/) { ++$$self{'xmlsubs_compiled_tag_recurse_parse'}; my $sub_script = &ParseHelper($self, \$text, 0); $text = ' &{sub{ my $out = ""; local $Response->{out} = local $Response->{BinaryRef} = \\$out; local *Apache::ASP::Response::Flush = *Apache::ASP::Response::Null; ' . $$sub_script . ' ; ${$Response->{out}}; }} '; } else { $text =~ s/\\/\\\\/sog; $text =~ s/\'/\\'/sog; $text = "'${text}'"; } ; "<% &$func({ $args }, $text); %>"; } ;]egsx
1000 8 8 if $args
1005 5 11 if ($text =~ /\<\%|\<($$self{'xml_subs_match'})/) { }
1039 15 0 if (defined $data)
1054 63 8 if (defined $data)
1070 0 32 if ($$self{'xml_subs_strict'}) { }
16 16 elsif ($$self{'xml_subs_perl_args'}) { }
1091 1 14 if length $1
1097 8 10 if length $value
1127 0 122 unless defined $file
1130 4 118 if ($file =~ s/^Share:://)
1135 4 118 if ($share_search)
1144 44 78 if (my $path = $$self{'search_dirs_cache'}{$cache_key})
1150 0 78 if ($file =~ m[^/|^[a-zA-Z]\:])
1151 0 0 if (-e $file and not -d _) { }
1161 74 15 if (-e $path and not -d _)
1179 0 0 unless ($$self{'register_includes'}{$include})
1184 0 0 $code ? :
1185 0 0 if $$self{'dbg'}
1197 2 109 if ($include =~ /^Share::/)
1202 17 94 if (ref $include) { }
1207 49 45 if ($is_base_script) { }
1216 2 43 unless defined $file
1222 5 87 if ($$self{'no_cache'})
1232 0 87 if ($compiled and not $$self{'stat_scripts'})
1233 0 0 if $$self{'dbg'}
1239 14 73 if ($compiled and $$compiled{'mtime'} > $mtime)
1244 3 11 if (my $includes = $Apache::ASP::Includes{$include})
1248 3 0 if (@stat) { }
1249 1 2 if ($stat[9] >= $v)
1250 0 1 if $$self{'dbg'}
1255 0 0 if $$self{'dbg'}
1262 13 1 if (not $includes_changed) { }
1265 0 1 if $$self{'dbg'}
1280 87 9 if ($$parse_data{'is_perl'}) { }
9 0 elsif ($$parse_data{'is_raw'}) { }
1285 81 6 unless ($no_cache)
1287 4 77 if ($no_cache)
1292 84 3 if ($sub)
1311 68 25 if ($data and $subid and not $no_cache)
1322 68 0 if ($code)
1323 16 52 if $$self{'dbg'}
1333 0 134 unless open READFILE, $file
1347 0 69 if ($file =~ m[^/] or $file =~ /^.\:/) { }
1351 2 67 if ($dir =~ m[^/] or $dir =~ /^.\:/) { }
1364 0 87 unless ref $script
1365 65 22 if $subid
1366 20 67 if $$self{'dbg'}
1384 40 47 if ($$self{'use_strict'}) { }
1399 3 84 if ($@) { }
1401 3 0 if $subid
1404 62 22 if ($subid) { }
1405 1 61 if (&config($self, 'RegisterIncludes'))
1420 4 77 $$script =~ /(^|\n)\s*sub\s+([^\s\{]+)\s*\{/ ? :
1426 66 140 unless ($$self{'response_tied'})
1448 1 48 if $$self{'stat_inc_match'} or $$self{'stat_inc'}
1451 49 0 unless ($$self{'errs'})
1453 49 0 unless ($compile_file)
1457 0 49 unless ($compile_file)
1465 0 49 unless ($compiled)
1479 46 3 if $$global_asa{'exists'}
1480 48 0 unless $$self{'errs'}
1482 49 0 unless $$self{'errs'}
1484 49 0 unless $$self{'errs'}
1487 0 49 if ($@)
1499 0 206 unless $code
1500 32 174 if $$self{'dbg'}
1506 2 204 if (my $ref = ref $code) { }
1507 1 1 if ($ref eq 'CODE') { }
1 0 elsif ($ref eq 'SCALAR') { }
1517 46 158 $code =~ /::/ ? :
1521 0 197 if ($@)
1530 0 48 unless $cache_name
1531 0 48 unless grep(($cache_name eq $_), ('XSLT', 'Response'))
1532 0 48 unless defined $key
1535 47 1 if (defined $cache_dbm) { }
1536 0 47 if $$self{'dbg'}
1543 0 1 if $$self{'dbg'}
1547 0 1 if $$self{'dbg'}
1550 48 0 ref $key && $key =~ /SCALAR/ ? :
1557 17 31 if (defined $value) { }
1559 6 11 if (defined $expires and $expires =~ /^\-?\d+$/)
1563 0 17 if $$self{'dbg'}
1569 0 31 if ($no_check_meta) { }
1570 0 0 if $$self{'dbg'}
1576 8 23 if (not $meta) { }
1581 1 6 if (defined $expires and $expires =~ /^\-?\d+$/ and $expires != $$meta{'Expires'})
1592 7 24 if (defined $last_modified)
1593 2 5 unless ($last_modified =~ /^\d+$/)
1596 0 2 if $$self{'dbg'}
1598 0 7 if ($last_modified < 0)
1599 0 0 if $$self{'dbg'}
1605 8 23 if ($$meta{'Timeout'})
1608 0 8 if $$self{'dbg'}
1612 0 31 if $$self{'dbg'}
1614 8 23 if ($new) { }
0 23 elsif (defined $$meta{'ServerID'} and $$ ne $Apache::ASP::ServerPID and $$meta{'ServerID'} ne $Apache::ASP::ServerID) { }
4 19 elsif ($$meta{'Timeout'} and $$meta{'Timeout'} <= time) { }
2 17 elsif (defined $last_modified and $last_modified >= $$meta{'Creation'}) { }
1615 0 8 if $$self{'dbg'}
1622 0 0 if $$self{'dbg'}
1626 0 4 if $$self{'dbg'}
1630 0 2 if $$self{'dbg'}
1634 0 17 if $$self{'dbg'}
1642 0 48 if ($@)
1658 0 0 if ($cache)
1659 0 0 if (my $data = $self->Cache('XSLT', \$cache_data, undef, undef, undef, 1))
1664 0 0 unless ref $xsl_data
1670 0 0 unless (($xslt_parser_lib) = grep(/^$xslt_parser/, @parsers))
1674 0 0 if $$asp{'dbg'}
1676 0 0 if $@
1679 0 0 unless length $$xsl_data and length $$xml_data
1681 0 0 if ($xslt_parser eq 'XML::XSLT') { }
0 0 elsif ($xslt_parser eq 'XML::Sablotron') { }
0 0 elsif ($xslt_parser eq 'XML::LibXSLT') { }
1688 0 0 if ($error)
1701 0 0 if ($cache)
1712 0 0 if ($$self{'r'}) { }
1728 0 3 if (ref $eval) { }
1769 0 0 if ($ref = ref $arg) { }
1770 0 0 if ($arg =~ /HASH/) { }
0 0 elsif ($arg =~ /ARRAY/) { }
0 0 elsif ($arg =~ /SCALAR/) { }
0 0 elsif ($arg =~ /CODE/) { }
1773 0 0 defined $$arg{$key} ? :
1782 0 0 if ($@) { }
1799 0 0 if ($$self{'dbg'} >= 3)
1801 0 0 if (eval { do { require Time::HiRes } })
1845 0 0 if ($@)
1852 0 0 if ($$self{'mail_host'} = &config($self, 'MailHost'))
1853 0 0 unless ($Apache::ASP::NetConfig{'smtp_hosts'} and ($Apache::ASP::NetConfig{'smtp_hosts'}[0] || '') eq $$self{'mail_host'})
1859 0 0 unless ($$mail{'Test'})
1861 0 0 unless $$mail{$_}
1867 0 0 if (not defined $args{'Debug'} and defined $$mail{'Debug'})
1871 0 0 unless (defined $args{'Debug'})
1873 0 0 if ((&config($self, 'Debug') || 0) < 0)
1881 0 0 if ($$mail{'Test'})
1886 0 0 if (not $smtp) { }
1894 0 0 unless $$mail{$receivers}
1895 0 0 ref $$mail{$receivers} ? :
1902 0 0 unless $smtp->mail($$mail{'From'})
1905 0 0 if ($$mail{'Test'})
1909 0 0 unless $smtp->to(@to)
1917 0 0 if ($$mail{'Content-Type'} and not $$mail{'MIME-Version'})
1923 0 0 unless $$mail{$_}
1924 0 0 if $done{lc $_}++
1925 0 0 ref $$mail{$_} ? :
1931 0 0 unless $smtp->data($data)
1934 0 0 if $rv
1944 0 0 if (defined $Apache::ASP::LoadedModules{$_})
1945 0 0 if ($Apache::ASP::LoadedModules{$_} == 0)
1946 0 0 if ($Apache::ASP::LoadModuleErrors{$category}) { }
1958 0 0 if ($@) { }
1959 0 0 if ($Apache::ASP::LoadModuleErrors{$category}) { }
1969 0 0 if $$self{'dbg'}
2018 0 828 if (lc $rv eq 'off')
2029 1 2923 if (defined $value) { }
2922 1 elsif (defined $key) { }
2033 259 2663 if (defined $rv) { }
2034 2 257 if (lc $rv eq 'off')
2039 575 2088 if (defined $default)