Branch Coverage

blib/lib/Plack/App/MCCS.pm
Criterion Covered Total %
branch 80 102 78.4


line true false branch
351 1 0 unless ($self->defaults and exists $self->defaults->{'minify'} and not $self->defaults->{'minify'})
354 4 0 if (can_load('modules', {'JavaScript::Minifier::XS', 0.09}))
359 4 0 if (can_load('modules', {'CSS::Minifier::XS', 0.08}))
365 1 0 unless ($self->defaults and exists $self->defaults->{'compress'} and not $self->defaults->{'compress'})
367 4 0 if (can_load('modules', {'IO::Compress::Gzip', undef}))
389 3 15 if ref $file and ref $file eq 'ARRAY'
397 0 1 if $self->defaults and exists $self->defaults->{'etag'} and not $self->defaults->{'etag'}
403 9 6 if (not $file =~ /\.min\.(css|js)$/ and $content_type eq 'text/css' || $content_type eq 'application/javascript')
409 7 2 if ($min and not ref $min) { }
422 0 7 if ($slm > $mlm) { }
434 2 7 if ($try_to_minify)
436 2 0 if ($content_type eq 'text/css' and $self->_can_minify_css or $content_type eq 'application/javascript' and $self->_can_minify_js)
439 0 2 unless open my $ifh, '<:raw', $orig
450 1 1 $content_type eq 'text/css' ? :
453 2 0 if ($min)
457 2 0 if ($ofh)
468 5 10 if ($$env{'HTTP_ACCEPT_ENCODING'} and $$env{'HTTP_ACCEPT_ENCODING'} =~ /gzip/)
471 3 2 if ($comp and not ref $comp) { }
485 0 3 if ($slm > $clm) { }
496 2 3 if ($try_to_compress and $self->_can_gzip)
500 2 0 if (IO::Compress::Gzip::gzip($orig, $out)) { }
518 0 32 if $path =~ /\0/
525 1 31 if grep {$_ eq '..';} @$path_arr
527 25 6 if (-f $full) { }
1 5 elsif (-d $full) { }
529 25 0 -r $full ? :
545 2 9 if ($ext and $self->types and $self->types->{$ext} and $self->types->{$ext}{'content_type'})
562 1 14 if $self->defaults and defined $self->defaults->{'valid_for'}
564 1 14 if $self->defaults and defined $self->defaults->{'cache_control'}
568 14 1 if ($ext)
569 6 5 if $self->types and $self->types->{$ext} and defined $self->types->{$ext}{'valid_for'}
571 5 6 if $self->types and $self->types->{$ext} and defined $self->types->{$ext}{'cache_control'}
576 1 14 scalar grep({$_ eq 'no-store';} @cache_control) ? :
577 14 1 if $cache
588 13 2 if $content_type =~ m[^(text/|application/(json|xml|javascript))]
600 14 1 if ($should_etag)
601 4 10 if (-f "$file.etag" and -r "$file.etag") { }
0 10 elsif (-f "$file.etag") { }
605 0 4 if ($stat[9] > (stat "$file.etag")[9]) { }
610 4 0 if (open ETag, '<', "$file.etag") { }
625 1 14 if ($$env{'HTTP_IF_MODIFIED_SINCE'})
634 1 0 if $stat[9] <= $since
637 1 2 if ($etag and $$env{'HTTP_IF_NONE_MATCH'} and $etag eq $$env{'HTTP_IF_NONE_MATCH'})
651 10 3 if ($should_etag and not $etag)
666 10 0 if (open ETag, '>', "$file.etag") { }
678 3 10 if $path =~ /\.gz$/
682 12 1 $valid_for >= 0 ? :
684 12 1 if $etag
698 75 0 if (@path) { }
699 75 0 if $path[0] eq ''
705 52 23 wantarray ? :