Branch Coverage

blib/lib/Plack/Middleware/Lint.pm
Criterion Covered Total %
branch 56 72 77.7


line true false branch
12 0 27 unless (&reftype($app) eq "CODE" or overload::Method($app, "&{}"))
13 0 0 defined $app ? :
30 1 33 unless ($env->{'REQUEST_METHOD'})
33 1 32 unless ($env->{'REQUEST_METHOD'} =~ /^[A-Z]+$/)
36 0 32 unless (defined $env->{'SCRIPT_NAME'})
39 1 31 if ($env->{'SCRIPT_NAME'} eq "/")
42 0 31 unless (defined $env->{'PATH_INFO'})
45 1 30 if ($env->{'PATH_INFO'} ne "" and not $env->{'PATH_INFO'} =~ m[^/])
48 0 30 unless (defined $env->{'SERVER_NAME'})
51 0 30 if ($env->{'SERVER_NAME'} eq "")
54 1 29 unless (defined $env->{'SERVER_PORT'})
57 0 29 if ($env->{'SERVER_PORT'} eq "")
60 1 28 if (defined $env->{'SERVER_PROTOCOL'} and not $env->{'SERVER_PROTOCOL'} =~ m[^HTTP/\d])
64 0 168 unless (exists $$env{"psgi.$param"})
68 1 27 unless (ref $env->{'psgi.version'} eq "ARRAY")
71 0 27 unless (scalar @{$env->{'psgi.version'};} == 2)
74 0 27 unless ($env->{'psgi.url_scheme'} =~ /^https?$/)
77 27 0 if ($env->{'psgi.version'}[1] == 1)
79 0 81 unless (exists $$env{"psgi.$param"})
84 1 26 if ($env->{'HTTP_CONTENT_TYPE'})
87 0 26 if ($env->{'HTTP_CONTENT_LENGTH'})
97 1 4 if ref $fh eq "GLOB" and *{$fh;}{"IO"}
103 1 27 unless (ref $res eq "ARRAY" or ref $res eq "CODE")
107 2 25 if (ref $res eq "CODE")
111 1 0 unless (@$res == 3 or $streaming and @$res == 2)
115 1 23 unless ($res->[0] =~ /^\d+$/ and $res->[0] >= 100)
119 1 22 unless (ref $res->[1] eq "ARRAY")
124 1 21 unless (@copy % 2 == 0)
129 1 15 if (lc $key eq "status")
132 4 11 if ($key =~ /[:\r\n]|[-_]$/)
135 2 9 unless ($key =~ /^[a-zA-Z][0-9a-zA-Z\-_]*$/)
138 2 7 if ($val =~ /[\000-\037]/)
141 2 5 unless (defined $val)
147 4 0 unless (@$res == 2 or ref $res->[2] eq "ARRAY" or &Plack::Util::is_real_fh($res->[2]) or is_possibly_fh($res->[2]) or &blessed($res->[2]) and $res->[2]->can("getline"))
155 1 5 if (ref $res->[2] eq "ARRAY" and grep _has_wide_char($_), @{$$res[2];})
167 3 2 if utf8::is_utf8($str)