Branch Coverage

blib/lib/CGI/Utils.pm
Criterion Covered Total %
branch 34 348 9.7


line true false branch
96 0 6 if (defined $ENV{'MOD_PERL'} and $ENV{'MOD_PERL'} ne '')
146 3 0 unless ref $args eq 'HASH'
160 0 0 if ref $self
161 0 0 if $r
163 0 0 if ($ENV{'MOD_PERL'})
164 0 0 if ($self->_getMasonObject) { }
0 0 elsif (defined $mod_perl::VERSION) { }
174 0 0 if $r
182 0 0 if (defined $mod_perl::VERSION) { }
183 0 0 if ($mod_perl::VERSION >= 1.99) { }
194 0 41 if ($ENV{'MOD_PERL'} and defined $mod_perl::VERSION)
203 0 0 if (defined ${'HTML::Mason::Commands::m';})
213 0 0 if ($m)
222 0 0 if (defined ${'HTML::Mason::Commands::r';})
230 39 0 if ($ENV{'GATEWAY_INTERFACE'})
241 0 30 if ($self->_isModPerl) { }
30 0 elsif ($self->_isCgi) { }
243 0 0 if $r
253 0 0 if ($self->_isModPerl) { }
0 0 elsif ($self->_isCgi) { }
255 0 0 if ($r)
269 0 0 if ($self->_isModPerl) { }
0 0 elsif ($self->_isCgi) { }
271 0 0 if ($r)
292 6 0 if ($] >= 5.006) { }
385 1 10 unless defined $sep
390 1 20 if ($ref eq 'ARRAY' or $ref =~ /=ARRAY/) { }
423 2 6 if (exists $$var_hash{$name}) { }
425 0 2 if (ref $this_val eq 'ARRAY') { }
436 0 2 wantarray ? :
453 0 0 unless defined $text
507 0 10 if ($port != 80 and $port != 443)
508 0 0 unless $host_url =~ /:\d+$/
544 0 9 if ($self->_isModPerl) { }
9 0 elsif ($self->_isCgi) { }
571 0 1 if ($self->_isModPerl) { }
573 0 0 $r ? :
578 1 0 if (defined $query_str and $query_str ne '')
653 0 3 if ($rel_url =~ m[^/]) { }
690 0 10 unless ref $param_hash eq 'HASH' and %$param_hash
691 7 3 unless defined $sep and $sep ne ''
692 3 7 if ($url =~ /^([^?]+)\?(.*)$/) { }
695 1 2 if ($query =~ /\&/)
698 2 1 unless $url =~ /\?$/
711 0 1 if ($self->_isModPerl) { }
713 0 0 $r ? :
745 0 0 if (exists $$params{'value'}) { }
749 0 0 if ($cookies and %$cookies)
771 0 0 if $$self{'_already_parsed'}
774 0 0 unless ref $args eq 'HASH'
776 0 0 if ($self->_isModPerl) { }
0 0 elsif (not $ENV{'GATEWAY_INTERFACE'}) { }
779 0 0 if $rv
782 0 0 if (scalar @ARGV)
800 0 0 if ($arg =~ /^([^=]+)=(.*)$/s) { }
823 0 0 if ($method eq 'post')
825 0 0 unless defined $max_size
826 0 0 if ($max_size > 0 and $content_length > $max_size)
831 0 0 if ($method eq 'post' and $ENV{'CONTENT_TYPE'} =~ m[^multipart/form-data]) { }
0 0 elsif ($method eq 'get' or $method eq 'head') { }
0 0 elsif ($method eq 'post') { }
832 0 0 if ($ENV{'CONTENT_TYPE'} =~ /boundary=(\"?)([^\";,]+)\1/) { }
843 0 0 if $content_length > 0
858 0 0 if ($self->_getMasonObject) { }
0 0 elsif ($r = $self->_getApacheRequest) { }
861 0 0 if (lc $method eq 'post' and $self->getContentType =~ m[^multipart/form-data])
864 0 0 if (@uploads)
885 0 0 if (lc $method eq 'post')
886 0 0 unless (defined $CGI::Utils::Has_Apache_Request)
894 0 0 if ($@) { }
901 0 0 if ($CGI::Utils::Has_Apache_Request) { }
0 0 elsif ($self->_isCgi) { }
907 0 0 if (scalar @vals > 1) { }
914 0 0 if ($self->getContentType =~ m[^multipart/form-data])
958 0 0 if (scalar @_ == 1 and wantarray)
963 0 0 unless defined $name
966 0 0 if (wantarray) { }
967 0 0 ref $val eq 'ARRAY' ? :
989 0 0 if (defined $$self{'_multivalue_delimiter'} and $$self{'_multivalue_delimiter'} ne '') { }
0 0 elsif (defined $multivalue_delimiter and $multivalue_delimiter ne '') { }
990 0 0 if not defined $multivalue_delimiter or $multivalue_delimiter eq ''
998 0 0 if (wantarray)
1002 0 0 if (ref $vars{$key} eq 'ARRAY')
1003 0 0 if ($multivalue_delimiter ne '') { }
1015 0 0 if $vars
1041 0 0 if defined $$self{'_path_info'}
1045 0 0 defined $ENV{'PATH_INFO'} ? :
0 0 $r ? :
1081 0 0 unless (defined $host and $host ne '')
1137 4 6 defined $https && lc $https eq 'on' ? :
1139 0 10 if defined $port and $port == 443
1171 0 0 if ($self->_isModPerl) { }
1247 0 0 if ($arg_count == 0)
1250 0 0 if ($arg_count == 1 and ref $args[0] ne 'HASH')
1265 0 0 unless defined $content_type
1266 0 0 if $content_type =~ /^text/ and not $content_type =~ /\bcharset\b/
1272 0 0 if defined $$params{'status'}
1273 0 0 if defined $$params{'target'}
1276 0 0 if (defined $cookies and $cookies)
1277 0 0 ref $cookies eq 'ARRAY' ? :
1281 0 0 if (UNIVERSAL::isa($cookie, 'CGI::Cookie')) { }
0 0 elsif (ref $cookie eq 'HASH') { }
1288 0 0 unless $str eq ''
1292 0 0 if (defined $$params{'expires'})
1297 0 0 if (defined $$params{'expires'} or defined $cookies and $cookies)
1301 0 0 if defined $$params{'attachment'}
1303 0 0 if defined $content_type and $content_type ne ''
1305 0 0 if ($$params{'mod_perl'})
1346 0 0 if ($self->_isModPerl and $r = $self->_getApacheRequest)
1351 0 0 if ($arg_count == 0)
1352 0 0 if ($mod_perl) { }
1360 0 0 if ($arg_count == 1 and ref $args[0] ne 'HASH')
1362 0 0 if ($mod_perl) { }
1371 0 0 unless ($mod_perl)
1377 0 0 unless $r
1380 0 0 if (ref $args[0] eq 'HASH') { }
1391 0 0 if (lc $$header[0] eq 'set-cookie') { }
1395 0 0 if (lc $$header[0] eq 'location')
1407 0 0 unless (defined $CGI::Utils::Loaded_Apache_Constants)
1450 0 0 unless $$params{'status'}
1480 0 0 unless $$params{'status'}
1502 0 0 unless ($$params{'location'} =~ m[^https?://])
1533 0 0 if (ref $cookies eq 'HASH')
1537 0 0 ref $cookies eq 'ARRAY' ? :
1543 0 0 if (UNIVERSAL::isa($cookie, 'CGI::Cookie')) { }
0 0 elsif (ref $cookie eq 'HASH') { }
1550 0 0 unless $str eq ''
1576 0 0 if ($r) { }
1595 0 0 if (my $ref = ref $value) { }
1596 0 0 if ($ref eq 'ARRAY') { }
0 0 elsif ($ref eq 'HASH') { }
1609 0 0 if $$params{'domain'}
1611 0 0 if ($$params{'expires'})
1616 0 0 if $$params{'secure'}
1631 0 0 unless $time =~ /^\d+$/
1639 0 0 unless $year > 1000
1647 0 0 unless $time =~ /^\d+$/
1653 0 0 unless $year > 1000
1662 0 0 if (not $offset or lc $offset eq 'now') { }
0 0 elsif ($offset =~ /^\d+$/) { }
0 0 elsif ($offset =~ /^([-+]?(?:\d+|\d*\.\d*))([mhdMy]?)/) { }
1687 0 0 if $arg_count == 0
1690 0 0 if ($arg_count == 1) { }
1691 0 0 if (ref $$args[0] eq 'HASH') { }
1695 0 0 if (ref $$map_list[0] eq 'ARRAY') { }
1700 0 0 wantarray ? :
1713 0 0 if (ref $e eq 'ARRAY') { }
1716 0 0 if ($e2 eq $key)
1722 0 0 if ($e eq $key)
1732 0 0 unless exists $$found{$key}
1735 0 0 wantarray ? :
1755 0 0 if (ref $val eq 'ARRAY')
1757 0 0 unless $delimiter eq ''
1816 0 0 if ($buf eq $sep)
1819 0 0 unless $amt_read < $content_length
1832 0 0 if $name eq ''
1834 0 0 if (exists $$params{$name}) { }
1836 0 0 if (ref $val eq 'ARRAY') { }
1860 0 0 if ($$disposition_fields{'filename'} ne '')
1872 0 0 if (substr($buf, -1, 1) eq $end_char and $buf =~ /^--$boundary(?:--)?$eol$/ and $body =~ /$eol$/)
1881 0 0 wantarray ? :
1902 0 0 if (substr($buf, -1, 1) eq $end_char and $buf =~ /^--$boundary(?:--)?$eol$/ and $buf2 =~ /$eol$/)
1914 0 0 if ($buf ne '')
1920 0 0 wantarray ? :
1947 0 0 if $buf eq $eol
1954 0 0 if ($line =~ /^(\S+):\s*(.+)$/) { }
0 0 elsif ($line =~ /^\s+/) { }
1962 0 0 wantarray ? :
1971 0 0 if $len == 0
1979 0 0 if ($char eq $end_char or $cur_len == $len)
1980 0 0 if ($offset > 0) { }
2012 0 0 if ($method eq 'DESTROY')
2016 0 0 if ($method =~ /\Aapache_(.+)/)
2020 0 0 unless ($@)