Branch Coverage

blib/lib/Plack/App/MCCS.pm
Criterion Covered Total %
branch 84 106 79.2


line true false branch
363 1 0 unless ($self->defaults and exists $self->defaults->{'minify'} and not $self->defaults->{'minify'})
366 4 0 if (can_load('modules', {'JavaScript::Minifier::XS', 0.09}))
371 4 0 if (can_load('modules', {'CSS::Minifier::XS', 0.08}))
377 1 0 unless ($self->defaults and exists $self->defaults->{'compress'} and not $self->defaults->{'compress'})
379 4 0 if (can_load('modules', {'IO::Compress::Gzip', undef}))
401 3 17 if ref $file and ref $file eq 'ARRAY'
410 0 1 if $self->defaults and exists $self->defaults->{'etag'} and not $self->defaults->{'etag'}
415 10 7 if (not $file =~ /\.min\.(css|js)$/ and $content_type eq 'text/css' || $content_type eq 'application/javascript')
418 1 9 if $self->min_cache_dir
422 7 3 if ($min and not ref $min) { }
435 0 7 if ($slm > $mlm) { }
447 3 7 if ($try_to_minify)
449 3 0 if ($content_type eq 'text/css' and $self->_can_minify_css or $content_type eq 'application/javascript' and $self->_can_minify_js)
452 0 3 unless &Plack::App::MCCS::open(my $ifh, '<:raw', $orig)
462 1 2 $content_type eq 'text/css' ? :
465 3 0 if ($min)
469 3 0 if ($ofh)
480 5 12 if ($env->{'HTTP_ACCEPT_ENCODING'} and $env->{'HTTP_ACCEPT_ENCODING'} =~ /gzip/)
483 3 2 if ($comp and not ref $comp) { }
497 0 3 if ($slm > $clm) { }
508 2 3 if ($try_to_compress and $self->_can_gzip)
512 2 0 if (IO::Compress::Gzip::gzip($orig, $out)) { }
530 0 35 if $path =~ /\0/
537 1 34 if grep {$_ eq '..';} @$path_arr
539 27 7 if (-f $full) { }
1 6 elsif (-d $full) { }
541 27 0 -r $full ? :
554 1 0 unless -d $min_cache_dir
566 2 7 if ($ext and $self->types and $self->types->{$ext} and $self->types->{$ext}{'content_type'})
584 1 16 if $self->defaults and defined $self->defaults->{'valid_for'}
586 1 16 if $self->defaults and defined $self->defaults->{'cache_control'}
589 16 1 if ($ext)
591 7 6 if $self->types and $self->types->{$ext} and defined $self->types->{$ext}{'valid_for'}
593 5 8 if $self->types and $self->types->{$ext} and defined $self->types->{$ext}{'cache_control'}
597 1 16 scalar grep({$_ eq 'no-store';} @cache_control) ? :
598 16 1 if $cache
609 15 2 if $content_type =~ m[^(text/|application/(json|xml|javascript))]
621 16 1 if ($should_etag)
622 3 13 if (-f "$file.etag" and -r "$file.etag") { }
0 13 elsif (-f "$file.etag") { }
626 0 3 if ($stat[9] > (stat "$file.etag")[9]) { }
631 3 0 if (&Plack::App::MCCS::open('ETag', '<', "$file.etag")) { }
646 1 16 if ($env->{'HTTP_IF_MODIFIED_SINCE'})
655 1 0 if $stat[9] <= $since
658 1 1 if ($etag and $env->{'HTTP_IF_NONE_MATCH'} and $etag eq $env->{'HTTP_IF_NONE_MATCH'})
672 13 2 if ($should_etag and not $etag)
687 13 0 if (&Plack::App::MCCS::open('ETag', '>', "$file.etag")) { }
699 3 12 if $path =~ /\.gz$/
703 14 1 $valid_for >= 0 ? :
705 14 1 if $etag
719 82 0 if (@path) { }
720 79 3 if $path[0] eq ''
726 55 27 wantarray ? :