Branch Coverage

lib/HTTP/Handy.pm
Criterion Covered Total %
branch 45 138 32.6


line true false branch
21 0 6 if ($] < "5.006" and not defined &warnings::import)
23 0 6 if $INC[-1] eq "."
90 0 0 unless my $app = $args{'app'}
91 0 0 defined $args{'host'} ? :
92 0 0 defined $args{'port'} ? :
93 0 0 defined $args{'log'} ? :
94 0 0 defined $args{'max_post_size'} ? :
96 0 0 unless ref $app eq "CODE"
97 0 0 unless $port =~ /^\d+$/
98 0 0 unless $max_post_size =~ /^\d+$/
107 0 0 unless ($server)
114 0 0 if $log
115 0 0 if $log
119 0 0 unless ($client)
120 0 0 if $log
130 0 0 if ($@)
131 0 0 if $log
146 0 0 unless defined $request_line and $request_line ne ""
153 0 0 unless (defined $method and $method eq 'GET' || $method eq 'POST')
160 0 0 if (defined $request_uri)
161 0 0 if ($request_uri =~ /^([^?]*)\?(.*)$/) { }
169 0 0 unless defined $path and $path ne ""
175 0 0 unless defined $line
177 0 0 if $line eq ""
179 0 0 if ($line =~ /^([^:]+):\s*(.*)$/)
193 0 0 $headers{'host'} && $headers{'host'} =~ /:(\d+)$/ ? :
200 0 0 if ($content_length > $max_post_size)
207 0 0 if ($method eq "POST" and $content_length > 0)
240 0 0 if ($@)
242 0 0 if $log
248 0 0 unless (ref $response eq "ARRAY" and scalar @$response == 3)
262 0 0 if (ref $resp_headers eq "ARRAY")
270 0 0 if @header_list
275 0 0 if (ref $body eq "ARRAY")
276 0 0 if @$body
286 0 0 if ($log)
304 0 0 if ($HTTP::Handy::ACCESS_LOG_FH)
317 0 0 if $char eq "\n"
319 0 0 if length $line > 8192
321 0 0 $line eq '' ? :
352 0 2 unless (open $fhn, ">> logs/error/error.log")
371 3 17 if ($path =~ /\.\./)
386 2 15 if (-d $file_check)
392 0 17 if ($file =~ /\x00/ or $file =~ /(?:^|\s)[|<>]|[|<>](?:\s|$)/)
396 2 15 unless (-f $file)
402 15 0 if ($file =~ /\.([^.]+)$/)
410 0 15 unless open $fhn, "< $file"
419 3 12 if (exists $opts{'cache_max_age'}) { }
421 2 1 if ($age > 0) { }
445 1 28 unless defined $str
456 2 6 unless defined $query and $query ne ""
460 0 10 unless defined $key
462 9 1 defined $val ? :
463 2 8 if (exists $params{$key}) { }
464 1 1 if (ref $params{$key} eq 'ARRAY') { }
493 2 3 defined $env->{'HTTP_HX_REQUEST'} && $env->{'HTTP_HX_REQUEST'} eq 'true' ? :
556 6 12 unless -d $dir
573 1 1 if defined $HTTP::Handy::ACCESS_LOG_FH and $current_log_filename eq $HTTP::Handy::CURRENT_LOG_FILE
575 0 1 if ($HTTP::Handy::ACCESS_LOG_FH)
582 0 1 unless (open $fhn, ">> $current_log_filename")
618 0 2 unless defined $data
631 1 1 if $length > $remaining
632 1 1 if $length <= 0
643 2 0 if ($whence == 0) { }
0 0 elsif ($whence == 1) { }
0 0 elsif ($whence == 2) { }
652 0 2 if $self->{'pos'} < 0
663 3 4 if $self->{'pos'} >= length $self->{'data'}
666 0 4 if ($nl < 0) { }