Branch Coverage

blib/lib/Mojolicious/Plugin/DefaultHelpers.pm
Criterion Covered Total %
branch 91 96 94.7


line true false branch
77 25 40 ref $_[0] eq 'CODE' ? :
84 77 48 if (defined $content)
85 42 35 if ($append)
86 2 75 if ($replace) { }
95 60 3 &blessed($e) && $e->isa('Mojo::Exception') ? :
101 1 16 unless my $route = (shift())->match->endpoint
102 2 14 @_ ? :
108 57 55 if $page eq "exception"
113 4 127 $_ eq 'app' ? :
134 346 if not /^mojo\./u
114 57 55 $page eq 'exception' ? :
120 57 55 $page eq 'exception' ? :
125 81 31 $mode eq 'development' ? :
126 108 4 if _fallbacks($c, $options, $page, $bundled)
135 124 2 unless @_
144 18 98 if $c->render_maybe(%$options)
147 56 42 if $c->render_maybe(%$options, "template", $template)
151 4 38 unless $options->{'format'} eq "html"
163 5 13 $session->{'flash'} ? :
18 7 if @_ == 1 and not ref $_[0]
166 1 6 ref $_[0] ? :
175 4 59 if $format eq "txt"
176 2 57 if $format eq "json"
183 2 57 if $format eq "txt"
184 2 55 if $format eq "json"
191 6 1 if $stream
203 1 1 if $c->app->mode eq "development"
234 0 21 unless my $stream = "Mojo::IOLoop"->stream($tx->connection)
236 3 18 $source_content->is_chunked ? :
240 9 1 length $data ? :
10 0 if $content->$write(length $data ? $data : ())
243 10 0 if $stream->can_write
249 21 0 if $content->$write("")
266 17 9 $res->is_redirect ? :
270 0 83 ref $_[0] ? :
276 79 4 @formats ? :
277 12 77 unless $target = $args->{$format}
283 6 77 unless ($target)
284 2 4 unless $target = $args->{'any'}
289 32 49 ref $target eq 'CODE' ? :
296 1 6 unless $c->app->static->serve($c, $file)
304 1 257 unless my $started = $c->stash->{'mojo.timing'}{$name}
308 1 258 $_[1] == 0 ? :
313 2 2 if defined $desc
314 2 2 if defined $dur
323 3 1 if $c->app->mode eq "development"
338 146 104 if $stash->{'mojo.validation'}
344 3 101 if $token and $header