Branch Coverage

blib/lib/Mojolicious/Plugin/CGI.pm
Criterion Covered Total %
branch 71 94 75.5


line true false branch
28 16 27 if ref $args eq 'ARRAY'
30 0 43 if ref $args->{'script'} eq 'CODE'
33 37 6 unless $app->renderer->helpers->{'cgi.run'}
37 2 41 if ($args->{'support_semicolon_in_query_string'} and not $app->{'mojolicious_plugin_cgi.before_dispatch'}++)
47 6 37 unless $args->{'route'}
48 0 35 unless $args->{'run'} or $args->{'script'}
50 37 0 unless ref $args->{'route'}
51 35 2 if $args->{'script'}
57 18 2 @$stderr ? :
61 1 19 if -s $stdin->path
62 0 20 unless open STDERR, $STDERR[0], $STDERR[1]
63 0 20 unless open STDOUT, '>&', fileno $stdout->[1]
71 0 20 $args->{'run'} ? :
83 1 19 $req->content->is_multipart ? :
93 2 18 if (my $userinfo = $c->req->url->to_abs->userinfo) { }
0 18 elsif (my $authenticate = $headers->authorization) { }
94 2 0 $userinfo =~ /([^:]+)/ ? :
97 0 0 $authenticate =~ /Basic\s+(.*)/ ? :
98 0 0 $remote_user =~ /([^:]+)/ ? :
101 17 3 if ($args->{'route'}) { }
3 0 elsif (my $name = $c->stash('script_name')) { }
106 3 0 $c->req->url->path =~ m[^(.*?/$name)] ? :
125 0 20 $req->is_secure ? :
0 20 $req->is_secure ? :
135 9 0 @_ > 1 ? :
9 47 @_ ? :
142 4 52 $args->{'run'} ? :
143 2 54 if $before
144 51 5 unless $args->{'errlog'}
145 0 56 unless defined($pid = fork)
146 20 36 unless $pid
152 3 69 unless $p->[0]
161 33 3 if $stderr[0]
166 36 0 if -e $stdin->path
172 0 36 if kill 0, $pid
173 33 3 if $c->res->code
202 0 33 if $headers
207 0 33 unless $buf =~ s/^(.*?\x0a\x0d?\x0a\x0d?)//s
210 6 27 if ($headers =~ /^HTTP/) { }
211 1 5 $headers =~ /^HTTP (\d\d\d)/ ? :
215 2 25 if $headers =~ /^Status: (\d\d\d)/m
216 1 24 $headers =~ /Location:/ ? :
25 2 unless $c->res->code
219 31 2 if length $buf
227 2 54 if ($c->req->content->is_multipart) { }
235 2 54 if $stdin->isa('Mojo::Asset::File')
246 0 36 unless waitpid $pid, 1