Condition Coverage

blib/lib/CGI.pm
Criterion Covered Total %
condition 330 532 62.0


and 3 conditions

line !l l&&!r l&&r condition
324 130 8 0 ref $initializer[0] and UNIVERSAL::isa($initializer[0], 'Apache') || UNIVERSAL::isa($initializer[0], 'Apache2::RequestRec')
331 130 5 3 ref $initializer[0] and UNIVERSAL::isa($initializer[0], 'CODE')
408 352 121 183 wantarray and $LIST_CONTEXT_WARN == 1
426 6 0 37 ref $value && ref $value eq 'ARRAY'
441 3 653 0 defined $name and $self->{'param'}{$name}
445 321 0 5 $PARAM_UTF8 and $name ne 'PUTDATA'
321 0 5 $PARAM_UTF8 and $name ne 'PUTDATA' and $name ne 'POSTDATA'
0 0 5 $PARAM_UTF8 and $name ne 'PUTDATA' and $name ne 'POSTDATA' and $name ne 'PATCHDATA'
465 166 3553 141 defined $_[0] and not ref $_[0]
3719 140 1 defined $_[0] and not ref $_[0] and $_[0] eq 'CGI'
466 166 3693 0 defined $_[0] and ref $_[0] eq 'CGI' || UNIVERSAL::isa($_[0], 'CGI')
477 0 187 0 defined $_[0] and substr(ref $_[0], 0, 3) eq 'CGI' || UNIVERSAL::isa($_[0], 'CGI')
514 131 2 5 @QUERY_PARAM and not defined $initializer
518 0 0 18 defined $val and ref $val eq 'ARRAY'
519 0 3 20 defined $_ and ref $_
542 133 0 0 $POST_MAX > 0 and $content_length > $POST_MAX
550 115 4 14 $meth eq 'POST' and defined $ENV{'CONTENT_TYPE'}
119 12 2 $meth eq 'POST' and defined $ENV{'CONTENT_TYPE'} and $ENV{'CONTENT_TYPE'} =~ m[^multipart/form-data]
16 0 2 $meth eq 'POST' and defined $ENV{'CONTENT_TYPE'} and $ENV{'CONTENT_TYPE'} =~ m[^multipart/form-data] and not defined $initializer
575 115 4 12 $meth eq 'POST' and defined $ENV{'CONTENT_TYPE'}
598 9 110 12 not $is_xforms and defined $initializer
603 7 4 1 ref $initializer and ref $initializer eq 'HASH'
610 7 0 4 defined $fh and $fh ne ''
643 7 0 6 $PUTDATA_UPLOAD || $self->{'.upload_hook'} and not $is_xforms
7 6 0 $PUTDATA_UPLOAD || $self->{'.upload_hook'} and not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH'
0 0 6 $PUTDATA_UPLOAD || $self->{'.upload_hook'} and not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH' and defined $ENV{'CONTENT_TYPE'}
0 0 6 $PUTDATA_UPLOAD || $self->{'.upload_hook'} and not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH' and defined $ENV{'CONTENT_TYPE'} and not $ENV{'CONTENT_TYPE'} =~ m[^application/x-www-form-urlencoded]
0 0 6 $PUTDATA_UPLOAD || $self->{'.upload_hook'} and not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH' and defined $ENV{'CONTENT_TYPE'} and not $ENV{'CONTENT_TYPE'} =~ m[^application/x-www-form-urlencoded] and not $ENV{'CONTENT_TYPE'} =~ m[^multipart/form-data]
679 9 124 0 not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH'
113 6 5 not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH' and defined $ENV{'CONTENT_TYPE'}
119 0 5 not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH' and defined $ENV{'CONTENT_TYPE'} and not $ENV{'CONTENT_TYPE'} =~ m[^application/x-www-form-urlencoded]
6 2 3 not $is_xforms and $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH' and defined $ENV{'CONTENT_TYPE'} and not $ENV{'CONTENT_TYPE'} =~ m[^application/x-www-form-urlencoded] and not $ENV{'CONTENT_TYPE'} =~ m[^multipart/form-data]
692 9 85 39 defined $query_string and length $query_string
726 0 0 0 not $query_string and $MOD_PERL == 2
810 82 0 0 $NO_UNDEF_PARAMS and not defined $value
828 0 439 0 defined $self and $self->{'.parameters'}
835 3 0 2 defined $_[1] and ref $_[1]
3 0 2 defined $_[1] and ref $_[1] and defined fileno $_[1]
886 516 0 245 ref $a and ref $a eq 'HASH'
1036 6 0 0 $needs_binmode and defined fileno $filehandle
1245 1 0 4 ref $arg and UNIVERSAL::isa($arg, 'CGI')
1255 0 18 1 defined $vals && index($vals, "\000") != -1
1532 54 37 0 $self->{'.header_printed'}++ and $HEADERS_ONCE
1545 80 1 15 defined $cs and $cs ne ''
1581 6 23 53 $type ne '' and not $type =~ /\bcharset\b/
29 2 51 $type ne '' and not $type =~ /\bcharset\b/ and defined $charset
25 6 45 $type ne '' and not $type =~ /\bcharset\b/ and defined $charset and $charset ne ''
1608 82 0 0 $MOD_PERL >= 1 and not $nph
1685 0 5 0 defined ref $dtd and ref $dtd eq 'ARRAY'
1694 5 0 7 ref $dtd eq 'ARRAY' and $dtd->[0] =~ /\bXHTML\b/i
1695 7 5 0 ref $dtd eq '' and $dtd =~ /\bXHTML\b/i
1696 5 7 0 $xml_dtd and $declare_xml
1698 5 0 7 ref $dtd and ref $dtd eq 'ARRAY'
1721 4 2 6 $XHTML and $encoding
6 0 6 $XHTML and $encoding and not $declare_xml
1738 10 0 2 $meta and ref $meta
10 0 2 $meta and ref $meta and ref $meta eq 'HASH'
1758 6 0 6 defined $meta_bits and not $meta_bits_set
1868 0 0 1 $src and $charset
1936 0 4 0 defined $p[0] and substr($p[0], 0, 1) eq '-'
2199 2 7 0 not $override and $self->{'.fieldnames'}{$name} || defined $self->param($name)
2221 244 6 1 @_ == 1 and $_[0] eq 'CGI'
2225 1 163 87 $encode_entities and $newlinestoo
2233 98 7 0 @_ == 1 and $_[0] eq 'CGI'
2256 1 0 0 @colheaders and @rowheaders
2342 8 4 1 $box_type eq 'radio' and not %checked
2347 8 5 0 $TABINDEX and $tabindex
2373 3 4 5 $checked{$_} && !$radio_checked++
2382 37 0 0 defined $nolabels and $nolabels
2384 33 2 2 defined $labels and defined $labels->{$_}
2428 2 6 0 not $override and defined $self->param($name)
2460 13 0 6 defined $labels and defined $labels->{$_}
2515 5 0 0 defined $labels and defined $labels->{$_}
2582 7 0 3 defined $labels and defined $labels->{$_}
2625 1 6 0 not $do_override and @prev
2694 3 20 21 $rewrite && $request_uri
2725 0 10 17 lc $protocol eq 'http' and $port == 80
10 0 0 lc $protocol eq 'https' and $port == 443
2737 24 0 20 $path_info and defined $path
2738 32 4 8 $query and $query_str ne ''
2773 0 0 0 defined $name and $name ne ''
2777 0 0 2 defined $name and $name ne ''
2823 0 0 0 $info ne '' and substr($info, 0, 1) ne '/'
2999 2 0 5 defined $match and $match
2 1 4 defined $match and $match and $user_agent
3242 1 0 0 defined $param2 and defined $param
3253 318 0 0 @_ == 1 and $_[0] eq 'CGI'
3256 0 244 60 ref $self and not $self->{'escape'}
3264 3 13 0 not $override and $self->{'.fieldnames'}{$name} || defined $self->param($name)
1 2 6 defined $defaults and ref $defaults
3 0 6 defined $defaults and ref $defaults and ref $defaults eq 'ARRAY'
3293 0 74 0 $DEBUG and @ARGV
3358 0 10 0 defined $header{'Content-Type'} && $header{'Content-Type'} =~ m[multipart/mixed]
3366 10 0 0 !defined($filename) || $filename eq '' and not $multipart
3385 10 0 0 !defined($filename) || $filename eq '' and $multipart
3400 10 0 0 $needs_binmode and defined fileno $filehandle
3511 2 0 0 $needs_binmode and defined fileno $filehandle
3591 27 0 0 ref $v eq 'HASH' and not ref $$l
3699 12 0 0 not $ok and $self->{'LENGTH'} <= 0
3822 7 0 32 not $self->{'CHUNKED'} and $self->{'LENGTH'} < $bytesToRead
3843 7 30 2 not $self->{'CHUNKED'} and $bytesRead
3850 15 0 3 length $self->{'BUFFER'} == 0 and $self->{'LENGTH'} <= 0

or 2 conditions

line l !l condition
975 80 10 $self->{'.etab'} ||= 1
1484 2 2 $type || 'text/html'
1568 0 28 $type ||= 'text/html'
1588 6 76 $ENV{'SERVER_PROTOCOL'} || 'HTTP/1.0'
1589 3 2 $status || '200 OK'
1709 2 10 $title || 'Untitled Document'
1843 0 1 $type ||= 'text/javascript'
1870 0 1 $code || ''
1913 11 1 $method || 'post'
2080 1 3 $script ||= ''
2162 0 0 $label || 'Defaults'
2502 2 1 $self->_maybe_escapeHTML($name) || ''
2557 1 2 $size || scalar @values
2688 24 20 $self->request_uri || ''
2715 16 11 http('x_forwarded_host') || http('host') || ''
2739 44 0 $url ||= ''
2827 6 4 $path_info || ''
2862 14 6 $ENV{'SCRIPT_NAME'} || ''
2863 14 6 $ENV{'PATH_INFO'} || ''
2864 6 14 $self->request_uri || ''
2968 0 0 $pref || 1
3024 0 0 $self->http('cookie') || $ENV{'COOKIE'} || ''
3044 0 0 $ENV{'REMOTE_HOST'} || $ENV{'REMOTE_ADDR'} || 'localhost'
3052 0 0 $ENV{'REMOTE_ADDR'} || '127.0.0.1'
3085 8 3 $ENV{'SERVER_NAME'} || 'localhost'
3092 0 5 $ENV{'SERVER_SOFTWARE'} || 'cmdline'
3113 36 31 $ENV{'SERVER_PORT'} || 80
3120 27 28 $ENV{'SERVER_PROTOCOL'} || 'HTTP/1.0'
3342 10 0 $header{'Content-Disposition'} ||= ''
3353 10 0 $filename ||= ''
3565 7 0 $self->{'.tmpfiles'}{$$filename . $filename}{'name'} || ''
3573 4 0 $self->{'.tmpfiles'}{$$filehandle . $filehandle}{'name'} || ''

or 3 conditions

line l !l&&r !l&&!r condition
319 138 0 0 ref $class || $class || $DefaultClass
324 0 0 8 UNIVERSAL::isa($initializer[0], 'Apache') || UNIVERSAL::isa($initializer[0], 'Apache2::RequestRec')
433 47 0 12 @values or defined $value
466 3431 54 208 ref $_[0] eq 'CGI' || UNIVERSAL::isa($_[0], 'CGI')
477 128 3 56 substr(ref $_[0], 0, 3) eq 'CGI' || UNIVERSAL::isa($_[0], 'CGI')
634 9 19 91 $is_xforms or $meth =~ /^(GET|HEAD|DELETE)$/
641 6 5 80 $meth eq 'POST' or $meth eq 'PUT'
11 3 77 $meth eq 'POST' or $meth eq 'PUT' or $meth eq 'PATCH'
643 3 0 10 $PUTDATA_UPLOAD || $self->{'.upload_hook'}
4 2 0 $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH'
679 10 1 113 $meth eq 'POST' || $meth eq 'PUT' || $meth eq 'PATCH'
736 0 20 1 $query_string ||= $ENV{'QUERY_STRING'}
744 0 10 0 $query_string ||= $ENV{"${key}QUERY_STRING"}
978 27 12 51 $TABINDEX or defined $new_value
1026 0 0 0 $ENV{'TEMP'} || $ENV{'TMP'} || ($ENV{'WINDIR'} ? $ENV{'WINDIR'} . $SL . 'TEMP' : undef)
1147 0 0 0 $delete or $MOD_PERL
0 0 0 $delete or $MOD_PERL or exists $ENV{'FCGI_ROLE'}
1248 0 1 0 $Q ||= $class->new(@_)
1418 2 1 1 length $escaped_param or length $value
1566 5 0 77 $nph ||= $NPH
1602 0 9 73 $expires or $cookie
9 5 68 $expires or $cookie or $nph
1637 8 2 0 $url ||= $self->self_url
1732 0 0 12 $base or $xbase
0 0 12 $base or $xbase or $target
1733 0 0 0 $xbase || $self->url('-path', 1)
1916 4 3 0 $enctype || &MULTIPART
1918 4 1 0 $enctype || &URL_ENCODED
1925 0 0 0 $self->request_uri || $self->self_url
2084 0 3 1 $value || $label
2199 0 6 1 $self->{'.fieldnames'}{$name} || defined $self->param($name)
2401 1 0 12 defined $columns or defined $rows
2613 0 5 2 ref $p[0] or substr($p[0], 0, 1) eq '-'
2683 12 5 27 $relative || $absolute
0 27 17 $base or not $relative || $absolute
2701 0 37 1 not defined $ENV{'SCRIPT_NAME'} or $ENV{'PATH_INFO'} ne $ENV{'SCRIPT_NAME'}
2720 16 11 0 $vh || server_name()
2725 17 0 10 lc $protocol eq 'http' and $port == 80 or lc $protocol eq 'https' and $port == 443
3032 0 0 0 http('x_forwarded_host') || http('host') || server_name()
3100 4 13 11 $self->http('x_forwarded_host') || $self->http('host')
3103 4 0 13 ($vh =~ /:(\d+)$/)[0] || ($protocol eq 'https' ? 443 : 80)
3200 0 0 0 $self->http('from') || $ENV{'REMOTE_IDENT'} || $ENV{'REMOTE_USER'}
3264 0 7 6 $self->{'.fieldnames'}{$name} || defined $self->param($name)
3366 0 0 10 !defined($filename) || $filename eq ''
3385 0 0 10 !defined($filename) || $filename eq ''
3390 0 0 0 $ENV{'TEMP'} || $ENV{'TMP'} || ($ENV{'WINDIR'} ? $ENV{'WINDIR'} . $SL . 'TEMP' : undef)
3501 0 0 0 $ENV{'TEMP'} || $ENV{'TMP'} || ($ENV{'WINDIR'} ? $ENV{'WINDIR'} . $SL . 'TEMP' : undef)
3676 0 3 0 ref $package || $package
3693 0 0 12 $CGI::OS eq 'VMS' or $CGI::EBCDIC
3695 12 0 0 $ok or $bad
3759 0 0 27 $bytes || $FILLUNIT
3774 22 0 0 $start >= 0 or $self->{'LENGTH'} > 0
5 0 22 $self->{'CHUNKED'} or ($start >= 0 or $self->{'LENGTH'} > 0)
3817 7 0 32 $self->{'CHUNKED'} or $self->{'LENGTH'}