Branch Coverage

blib/lib/Apache/ParseLog.pm
Criterion Covered Total %
branch 229 364 62.9


line true false branch
264 8 2 if (defined $httpd_conf)
265 0 8 if (not -e $httpd_conf) { }
421 1 7 $virtualhost ? :
426 8 319 if ($line =~ /^ServerRoot\s+(.+)$/) { }
7 312 elsif ($line =~ /^Port\s+(.+)$/) { }
44 268 elsif ($line =~ /^LogFormat\s+"(.+)"\s+(\w+)$/) { }
433 256 71 unless ($VIRTUAL)
434 7 249 if ($line =~ /^ServerName\s+(.+)$/) { }
7 242 elsif ($line =~ /^ServerAdmin\s+(.+)$/) { }
6 236 elsif ($line =~ /^TransferLog\s+(.+)$/) { }
7 229 elsif ($line =~ /^ErrorLog\s+(.+)$/) { }
6 223 elsif ($line =~ /^AgentLog\s+(.+)$/) { }
6 217 elsif ($line =~ /^RefererLog\s+(.+)$/) { }
39 178 elsif ($line =~ /^CustomLog\s+(.+)\s+(\w+)$/) { }
449 0 39 if ($loc =~ /\|/) { }
39 0 elsif (not $loc =~ m[^/]) { }
454 46 281 if (defined $virtualhost) { }
455 1 45 if ($line =~ /^/) { }
1 44 elsif ($line =~ m[^]) { }
456 1 0 if ($1 =~ /$virtualhost/i)
463 6 275 if ($line =~ /^
6 269 elsif ($line =~ m[^]) { }
475 6 2 if ($transferlog)
476 6 0 if (not $transferlog =~ m[^/]) { }
0 0 elsif ($transferlog =~ /\|/) { }
483 7 1 if ($errorlog)
484 7 0 if (not $errorlog =~ m[^/]) { }
0 0 elsif ($errorlog =~ /\|/) { }
491 6 2 if ($agentlog)
492 6 0 if (not $agentlog =~ m[^/]) { }
0 0 elsif ($agentlog =~ /\|/) { }
499 6 2 if ($refererlog)
500 6 0 if (not $refererlog =~ m[^/]) { }
0 0 elsif ($refererlog =~ /\|/) { }
704 6 3 if ($_ eq $nickname)
735 6 0 if (customlogDefined($this, $nickname)) { }
767 4 0 if -e customlogLocation($this, $nickname)
790 2 0 if (customlogExists($this, $nickname)) { }
817 0 2 unless -e $logfile
843 0 1 unless -e $logfile
869 0 1 unless -e $logfile
895 0 1 unless -e $logfile
902 56 12 if ($line =~ /^\[/) { }
909 24 32 if $d =~ /^\d$/
914 44 12 if ($keyword eq 'error') { }
3 9 elsif ($keyword eq 'notice') { }
9 0 elsif ($keyword eq 'warn') { }
936 56 0 if $line
940 12 0 if $line
990 0 2 unless customlogExists($this, $nickname)
992 0 2 unless -e $logfile
1021 1 19 if ($2 eq '%h') { }
1 18 elsif ($2 eq '%l') { }
1 17 elsif ($2 eq '%u') { }
2 15 elsif ($2 eq '%t') { }
1 14 elsif ($2 eq '%r') { }
1 13 elsif ($2 eq '%s') { }
1 12 elsif ($2 eq '%>s') { }
1 11 elsif ($2 eq '%b') { }
1 10 elsif ($2 eq '%f') { }
1 9 elsif ($2 eq '%a') { }
1 8 elsif ($2 eq '%p') { }
1 7 elsif ($2 eq '%P') { }
1 6 elsif ($2 eq '%T') { }
2 4 elsif ($2 eq '%U') { }
1 3 elsif ($2 eq '%v') { }
1 2 elsif ($2 =~ /Referer/i) { }
1 1 elsif ($2 =~ /User-agent/i) { }
1083 4 32 if (/^HOST/ and $hostswitch) { }
4 28 elsif (/DATETIME/ || /BYTE/ and not $dtbyteswitch) { }
3 25 elsif (/DATETIME/ || /BYTE/ and $dtbyteswitch) { }
3 22 elsif (/REQUEST/) { }
4 18 elsif (/FILENAME/ or /URL/) { }
1 17 elsif (/SEC/ and $fileswitch) { }
2 15 elsif (/UAGENT/) { }
2 13 elsif (/REFERER/) { }
1086 1 3 if ($dtswitch and not $visitordone) { }
1093 4 0 if (/DATETIME/) { }
1095 3 1 if ($visitorswitch) { }
1106 0 3 if (/DATETIME/) { }
1108 0 0 if ($visitorswitch) { }
1174 1 5 if (scalar @elements == 1 and $elements[0] eq 'UAGENT')
1192 89 152 if $HOST
1194 29 212 if $HOSTNAME
1195 89 152 $HOST ? :
1197 118 123 if ($domain)
1198 118 0 if (not $domain =~ /^\d{1,3}(?:\.\d{1,3}){3}$/) { }
1199 118 0 if ($domain =~ /\.([A-Za-z0-9\-]+\.)(\w+)$/) { }
1216 89 152 if $LOGIN
1218 89 152 if $USER
1220 118 123 if ($DATETIME)
1222 0 118 $1 =~ /^\d$/ ? :
1231 68 50 if ($BYTE and $BYTE =~ /^\d+$/)
1237 89 29 if ($HOST) { }
29 0 elsif ($HOSTNAME) { }
0 0 elsif ($ADDR) { }
1245 29 212 if ($OSTATUS)
1249 89 152 if ($LSTATUS)
1254 29 212 if $FILENAME
1256 29 212 if $ADDR
1258 29 212 if $PORT
1260 29 212 if $PROC
1264 89 152 if ($REQUEST)
1270 0 89 if ($file =~ /\?(.+)$/)
1281 88 153 if ($URL)
1286 93 148 unless $FILE
1288 8 233 if ($SEC)
1289 0 8 unless $FILE
1290 0 8 if (exists $sec{$FILE}) { }
1291 0 0 if $SEC > $sec{$FILE}
1297 68 173 if ($BYTE and $BYTE =~ /^\d+$/)
1299 0 68 unless $FILE
1301 48 20 if ($1) { }
1310 59 182 if ($REFERER)
1312 59 0 if ($URL) { }
0 0 elsif ($FILE) { }
0 0 elsif ($FILENAME) { }
1315 59 0 $refered ? :
1317 52 7 if ($REFERER =~ m[http://(\S+?)[/?]]) { }
7 0 elsif ($REFERER =~ /^-$/) { }
1323 120 121 if ($UAGENT)
1328 120 0 if $parser
1330 19 101 if ($UAGENT =~ /^Mozilla/ and $rest =~ /(Webtv.+?)[;)]/ || $rest =~ /(AOL.+?)[;)]/ || $rest =~ /(MSN.+?)[;)]/ || $rest =~ /(MSIE.+?)[;)]/) { }
0 101 elsif ($UAGENT =~ /Mozilla/ and $rest =~ /compatible\;\s+(.+?)[;)]/) { }
1345 75 45 if ($rest =~ /(Win.+?)[;)]/) { }
9 36 elsif ($rest =~ /(Mac.+?)[;)]/) { }
34 2 elsif ($rest =~ /X11\;\s+.+?\;\s+(.+?)[;)]/) { }
1464 0 1 unless $$this{'hit'}
1484 0 1 unless $$this{'host'}
1509 0 0 unless $$this{'topdomain'}
1532 0 0 unless $$this{'secdomain'}
1555 0 0 unless $$this{'login'}
1578 0 1 unless $$this{'user'}
1599 0 1 unless $$this{'hitbydate'}
1619 0 0 unless $$this{'hitbytime'}
1639 0 0 unless $$this{'hitbydatetime'}
1659 0 1 unless $$this{'visitorbydate'}
1679 0 0 unless $$this{'visitorbytime'}
1699 0 0 unless $$this{'visitorbydatetime'}
1719 0 0 unless $$this{'method'}
1739 0 1 unless $$this{'file'}
1759 0 0 unless $$this{'querystring'}
1779 0 0 unless $$this{'proto'}
1800 0 1 unless $$this{'lstatus'}
1822 0 1 unless $$this{'byte'}
1842 0 0 unless $$this{'bytebydate'}
1862 0 0 unless $$this{'bytebytime'}
1884 0 0 unless $$this{'bytebydatetime'}
1948 0 1 unless $$this{'count'}
1968 0 1 unless $$this{'allbydate'}
1988 0 0 unless $$this{'allbytime'}
2008 0 0 unless $$this{'allbydatetime'}
2028 0 1 unless $$this{'allmessage'}
2048 0 1 unless $$this{'errorbydate'}
2068 0 0 unless $$this{'errorbytime'}
2088 0 0 unless $$this{'errorbydatetime'}
2108 0 0 unless $$this{'errormessage'}
2128 0 1 unless $$this{'noticebydate'}
2148 0 0 unless $$this{'noticebytime'}
2168 0 0 unless $$this{'noticebydatetime'}
2188 0 0 unless $$this{'noticemessage'}
2208 0 1 unless $$this{'warnbydate'}
2228 0 0 unless $$this{'warnbytime'}
2248 0 0 unless $$this{'warnbydatetime'}
2270 0 0 unless $$this{'warnmessage'}
2309 0 1 unless $$this{'referer'}
2337 0 1 unless $$this{'refererdetail'}
2372 0 1 unless $$this{'uagent'}
2396 0 1 unless $$this{'uaversion'}
2420 0 1 unless $$this{'browser'}
2444 0 1 unless $$this{'platform'}
2466 0 1 unless $$this{'browserbyos'}
2501 0 1 unless $$this{'addr'}
2521 0 1 unless $$this{'filename'}
2541 0 0 unless $$this{'hostname'}
2562 0 1 unless $$this{'ostatus'}
2583 0 0 unless $$this{'port'}
2604 0 1 unless $$this{'proc'}
2628 0 1 unless $$this{'sec'}
2650 0 1 unless $$this{'url'}
2712 0 0 unless $$this{'methods'}
2844 0 15 unless open FH, "<$file"