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 ''
2825 0 0 0 $info ne '' and substr($info, 0, 1) ne '/'
3001 2 0 5 defined $match and $match
2 1 4 defined $match and $match and $user_agent
3244 1 0 0 defined $param2 and defined $param
3255 318 0 0 @_ == 1 and $_[0] eq 'CGI'
3258 0 244 60 ref $self and not $self->{'escape'}
3266 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'
3295 0 74 0 $DEBUG and @ARGV
3360 0 10 0 defined $header{'Content-Type'} && $header{'Content-Type'} =~ m[multipart/mixed]
3368 10 0 0 !defined($filename) || $filename eq '' and not $multipart
3387 10 0 0 !defined($filename) || $filename eq '' and $multipart
3402 10 0 0 $needs_binmode and defined fileno $filehandle
3513 2 0 0 $needs_binmode and defined fileno $filehandle
3593 27 0 0 ref $v eq 'HASH' and not ref $$l
3701 12 0 0 not $ok and $self->{'LENGTH'} <= 0
3824 7 0 32 not $self->{'CHUNKED'} and $self->{'LENGTH'} < $bytesToRead
3845 7 30 2 not $self->{'CHUNKED'} and $bytesRead
3852 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 ||= ''
2829 6 4 $path_info || ''
2864 14 6 $ENV{'SCRIPT_NAME'} || ''
2865 14 6 $ENV{'PATH_INFO'} || ''
2866 6 14 $self->request_uri || ''
2970 0 0 $pref || 1
3026 0 0 $self->http('cookie') || $ENV{'COOKIE'} || ''
3046 0 0 $ENV{'REMOTE_HOST'} || $ENV{'REMOTE_ADDR'} || 'localhost'
3054 0 0 $ENV{'REMOTE_ADDR'} || '127.0.0.1'
3087 8 3 $ENV{'SERVER_NAME'} || 'localhost'
3094 0 5 $ENV{'SERVER_SOFTWARE'} || 'cmdline'
3115 36 31 $ENV{'SERVER_PORT'} || 80
3122 27 28 $ENV{'SERVER_PROTOCOL'} || 'HTTP/1.0'
3344 10 0 $header{'Content-Disposition'} ||= ''
3355 10 0 $filename ||= ''
3567 7 0 $self->{'.tmpfiles'}{$$filename . $filename}{'name'} || ''
3575 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
3034 0 0 0 http('x_forwarded_host') || http('host') || server_name()
3102 4 13 11 $self->http('x_forwarded_host') || $self->http('host')
3105 4 0 13 ($vh =~ /:(\d+)$/)[0] || ($protocol eq 'https' ? 443 : 80)
3202 0 0 0 $self->http('from') || $ENV{'REMOTE_IDENT'} || $ENV{'REMOTE_USER'}
3266 0 7 6 $self->{'.fieldnames'}{$name} || defined $self->param($name)
3368 0 0 10 !defined($filename) || $filename eq ''
3387 0 0 10 !defined($filename) || $filename eq ''
3392 0 0 0 $ENV{'TEMP'} || $ENV{'TMP'} || ($ENV{'WINDIR'} ? $ENV{'WINDIR'} . $SL . 'TEMP' : undef)
3503 0 0 0 $ENV{'TEMP'} || $ENV{'TMP'} || ($ENV{'WINDIR'} ? $ENV{'WINDIR'} . $SL . 'TEMP' : undef)
3678 0 3 0 ref $package || $package
3695 0 0 12 $CGI::OS eq 'VMS' or $CGI::EBCDIC
3697 12 0 0 $ok or $bad
3761 0 0 27 $bytes || $FILLUNIT
3776 22 0 0 $start >= 0 or $self->{'LENGTH'} > 0
5 0 22 $self->{'CHUNKED'} or ($start >= 0 or $self->{'LENGTH'} > 0)
3819 7 0 32 $self->{'CHUNKED'} or $self->{'LENGTH'}