Branch Coverage

blib/lib/MVC/Neaf/Request.pm
Criterion Covered Total %
branch 151 202 74.7


line true false branch
95 1 0 unless @fwd == 1 and $fwd[0] or $self->do_get_client_ip
108 2 0 unless (exists $self->{'http_version'})
124 9 4 unless (exists $self->{'scheme'})
245 2 0 defined $new_path ? :
269 0 5 unless $self->{'route'} and $self->{'route'}->path =~ m[^(?:/|$)]
322 4 3 if defined $h{$_}
335 2 1 $self->port == ($port_scheme{$self->scheme} || 0) ? :
377 0 1 unless $self->{'path_info_split'}
387 136 157 if (defined $path)
416 1 1 unless defined $path_info
422 1 1 length $self->{'postfix'} ? :
476 2 41 unless defined $regex
482 15 26 unless defined $value
483 21 5 if $value =~ /^(?:$regex)$/s
485 1 4 if (length $value and $self->route->strict)
516 1 1 if ($query_allowed{$self->method})
525 0 1 unless /^(.*?)(?:=(.*))?$/
536 0 1 unless defined $value
537 1 0 if $value =~ /^(?:$regex)$/s
539 0 0 if (length $value and $self->route->strict)
575 0 9 unless defined $regex
583 3 6 if (grep {not /^(?:$regex)$/s;} @$ret) { }
584 0 3 if $self->route->strict
649 4 3 unless (ref $validator)
654 0 6 ref $validator eq 'CODE' ? :
687 0 2 unless wantarray
690 1 1 unless ref $spec eq "ARRAY"
736 0 6 if $query_allowed{$self->method}
739 6 0 unless exists $self->{'body'}
834 0 1 unless my $id = $args{'id'}
836 1 0 unless (exists $self->{'uploads'}{$id})
838 0 1 ref $raw eq 'HASH' ? :
868 30 1 unless defined $default
869 0 31 unless defined $regex
882 10 21 unless defined $value
884 17 4 if $value =~ /^$regex$/
886 4 0 if (length $value and $self->route->strict)
932 0 9 if defined $opt{'regex'} and not $cook =~ /^$opt{'regex'}$/
934 0 9 if (exists $opt{'expires'})
941 1 8 if ($opt{'ttl'})
995 0 9 unless defined $cook
997 9 0 unless defined $path
998 7 2 if defined $expire
999 0 9 defined $domain ? :
7 2 defined $expire ? :
0 9 $secure ? :
0 9 $httponly ? :
1101 3 40 unless defined $name
1108 37 3 if ($regex)
1109 3 34 unless ref $regex and ref $regex eq "Regexp"
1115 26 12 wantarray ? :
1128 0 2 if (@_) { }
1145 0 3 if (@_) { }
1149 2 1 unless exists $self->{'user_agent'}
1167 0 6 if $query_allowed{$self->method}
1170 0 6 unless defined $ctype
1195 1 0 if defined $self->{'postfix'}
1220 16 4 if (my $sess = $self->load_session)
1239 11 12 if exists $self->{'session'}
1242 0 12 unless $setup
1249 3 9 if (not $hash) { }
1 8 elsif (ref $hash ne 'HASH') { }
7 1 elsif ($hash->{'data'}) { }
1262 1 6 if $hash->{'id'}
1292 5 1 if (@_)
1297 0 6 unless $setup
1305 6 0 if ($hash and ref $hash eq "HASH")
1328 0 1 unless $setup->{'engine'}
1331 1 0 if $id
1388 372 2 unless @_
1453 1 161 unless ref $data and UNIVERSAL::isa($data, "HASH")
1458 0 48 if defined $data->{'-headers'} and ref $data->{'-headers'} ne 'ARRAY' || @{$data->{'-headers'};} % 2
1460 0 161 if $self->{'response'}{'ret'}
1513 1 2 unless @_
1515 0 2 unless @_ > 1
1517 0 2 if @_ % 2
1550 5 3 unless ref $code eq "ARRAY"
1552 0 8 if grep {ref $_ ne "CODE";} @$code
1557 4 4 $prepend_flag ? :
1580 0 46 unless $self->{'continue'}
1582 46 0 if defined $data
1600 0 3 unless $self->{'continue'}
1617 0 1 if $self->{'continue'}
1668 0 1 unless not $id or $id =~ /^[\x21-\x7E]+$/ and not $id =~ /[\s\"\\]/
1731 0 157 unless defined $$content
1735 48 109 if (my $append = $data->{'-headers'})
1745 48 109 if (&Encode::is_utf8($$content)) { }
50 59 elsif (not $data->{'-type'}) { }
54 5 elsif ($data->{'-type'} =~ m[^text/]) { }
1750 10 38 unless $data->{'-type'} =~ /; charset=/
1753 1 49 $$content =~ /^.{0,512}?[^\s\x20-\x7F]/s ? :
1759 14 40 unless $data->{'-type'} =~ /; charset=/
1768 0 157 if $data->{'-location'}
1771 155 2 unless $data->{'-continue'}
1774 3 154 if ($data->{'-status'} == 200 and my $ttl = $self->route->cache_ttl)
1786 3 154 if (my $hooks = $route->hooks->{'pre_cleanup'})
1789 5 152 if (my $hooks = $route->hooks->{'pre_reply'})
1804 1 156 if ($self->method eq 'HEAD') { }
2 154 elsif ($data->{'-continue'}) { }
1822 1 166 if exists $self->{'response'}{'postponed'}
2038 0 4 unless $self->{'route'}{'caller'}