Branch Coverage

blib/lib/Mojolicious/Plugin/Images/Util.pm
Criterion Covered Total %
branch 31 48 64.5


line true false branch
16 0 69 unless @_ <= 2
0 69 unless @_ >= 2
17 19 50 if $INSECURE_DIRS
20 19 31 if not $dir or 'Mojo::Path'->new($app->home)->contains("$dir")
25 0 72 unless @_ <= 1
0 72 unless @_ >= 1
26 22 50 if $INSECURE_IDS
27 5 45 unless $id =~ m[^[\ \-\w/]+$]u
32 0 45 unless @_ >= 2
37 0 45 unless @_ <= 3
0 45 unless @_ >= 3
38 2 43 unless defined $url_prefix
41 20 23 unless io()->dir($dir)->is_absolute
46 12 31 unless $dir =~ s/$prefix$//u
51 0 34 unless @_ <= 3
0 34 unless @_ >= 3
52 11 23 unless my $static_path = calc_static($dir, $url_prefix, $app->home)
55 9 11 unless grep {$_ eq $static_path;} @$paths
59 0 21 unless @_ <= 3
0 21 unless @_ >= 3
62 20 1 if $$opts{'ext'}
70 0 0 unless @_ <= 2
0 0 unless @_ >= 2
75 0 0 if $img->exists($id) or $img->sync($id)