Branch Coverage

blib/lib/Apache2/SSI/File/Type.pm
Criterion Covered Total %
branch 58 336 17.2


line true false branch
72 0 2 if @_ % 2
74 0 2 if length $file
99 0 2 if ($Nice::Try::WANTARRAY) { }
2 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 2 length $@ ? :
0 0 if ($Nice::Try::HAS_CATCH)
0 2 if ($Nice::Try::DIED)
102 0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 2 $Nice::Try::WANTARRAY ? :
2 0 if (defined $Nice::Try::WANTARRAY and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL'))
105 0 2 if ($opts->{'magic'}) { }
0 2 elsif ($MAGIC_DATA and scalar @$MAGIC_DATA) { }
110 0 0 if ($file_abs eq $MAGIC_DATA_SOURCE and scalar @$MAGIC_DATA) { }
120 0 0 if (-e $path and -s $path) { }
123 0 0 unless &$load_json_data($path)
127 0 0 unless -e $file
154 0 2 unless -e $file
155 0 2 unless &$load_json_data($file)
252 0 0 if (length $data <= 0)
254 0 0 $self->{'default_type'} ? :
261 0 0 unless (defined $type)
265 0 0 unless (defined $type)
267 0 0 $self->{'default_type'} ? :
281 0 0 unless defined $data
282 0 0 unless defined $depth
285 0 0 unless $err->fdopen(fileno STDERR, 'w')
292 0 0 if scalar @$entry == 3
293 0 0 unless defined $entry
296 0 0 if ($offtype == 1) { }
0 0 elsif ($offtype == 2) { }
311 0 0 if ($mask)
317 0 0 if ($subtests)
349 0 3 if (not -e $file) { }
0 3 elsif (not -r $file) { }
351 0 0 if ($self->{'error_returns_undef'}) { }
364 0 0 if ($self->{'error_returns_undef'}) { }
376 3 0 if ($self->follow_links) { }
385 0 3 if (not -f _ or -z _)
387 0 0 if (not $self->follow_links and -l _) { }
0 0 elsif (-d _) { }
0 0 elsif (-p _) { }
0 0 elsif (-S _) { }
0 0 elsif (-b _) { }
0 0 elsif (-c _) { }
0 0 elsif (-z _) { }
403 0 0 $self->{'default_type'} ? :
428 2 1 if (-x $file and -T _)
433 2 0 if ($line1 =~ /^\#![[:blank:]\h]*(\S+)/)
458 1 2 unless length $opts->{'default'}
471 3 261 if ($test = $self->_magic_match($self->{'magic_data'}[$m], \$desc, $io)) { }
33 228 elsif (not defined $test) { }
474 3 0 if (defined $desc and $desc ne '')
483 0 33 if warnings::enabled() and $self->debug
489 0 0 if ($m == $#{$$self{'magic_data'};} and $self->{'magic'}{'io'} and not $self->{'magic'}{'io'}->eof)
500 0 3 unless ($match_found)
507 0 3 unless (defined $type)
509 0 0 $opts->{'default'} ? :
550 0 0 if ($line =~ s/^>*([&\(]?[a-flsx\.\+\-\d]+\)?)[[:blank:]\h]+(\S+)[[:blank:]\h]+//) { }
553 0 0 if ($offset =~ /^\(/) { }
0 0 elsif ($offset =~ /^&/o) { }
559 0 0 if (($o1, $type, $o2) = $offset =~ /\((\d+)(\.[bsl])?([\+\-]?\d+)?\)/) { }
561 0 0 if $o1 =~ /^0/o
562 0 0 if $o2 =~ /^0/o
566 0 0 if $type eq ''
586 0 0 if $offset =~ /^0/o
594 0 0 if $offset =~ /^0/o
603 0 0 if ($type =~ s/&(.*)//)
607 0 0 if $mask =~ /^0/o
611 0 0 unless (exists $TEMPLATES->{$type})
617 0 0 if ($line =~ s/([^\\])\s+(.*)/$1/) { }
630 0 0 if ($line =~ s/^([><&^=!])//o) { }
0 0 elsif ($line eq 'x') { }
643 0 0 if ($type eq 'string') { }
651 0 0 unless $ESC->{$1}
655 0 0 if ($operator =~ /[>x]/o) { }
0 0 elsif ($operator =~ /[=<]/o) { }
0 0 elsif ($operator eq '!') { }
681 0 0 if ($operator ne 'x')
685 0 0 if ($line =~ /^0/o) { }
698 0 0 if (ref $template)
700 0 0 unless $operator eq '>' or $operator eq '<'
732 0 0 unless defined $line
733 0 0 if ($line =~ /^\#/ or $line =~ /^[[:blank:]\h]*$/)
736 0 0 if $io->eof
743 0 0 unless defined $this_depth
744 0 0 unless defined $depth
747 0 0 if (length $this_depth > $depth) { }
0 0 elsif (length $this_depth < $depth) { }
0 0 elsif (@$entry) { }
753 0 0 if ($self->read_magic_entry($entry->[2], $depth + 1) < $depth or $io->eof)
789 0 0 if $io->eof
790 0 0 if $io->eof
808 0 0 if length $data <= 0
815 0 0 if ($self->_magic_match_str($self->{'magic_data'}[$m], \$desc, $data))
817 0 0 if (defined $desc and $desc ne '')
827 0 0 if ($m == $#{$$self{'magic_data'};} and not $self->{'magic'}{'io'}->eof)
841 0 0 if length $data <= 0
846 0 0 if (_is_binary($data)) { }
859 0 0 if ($tdata =~ /$token/gm)
865 0 0 if (scalar keys %val)
888 0 0 if ($fname =~ /$regex/i)
890 0 0 if (defined $type and not $type =~ /;/ or not defined $type)
908 0 0 if $len <= 0
910 0 0 if $count / $len > 0.1
927 0 264 if @$item == 3
930 0 264 unless defined $item
934 0 264 unless defined $io
943 0 264 if ($self->{'trick'} > 186 and $self->{'trick'} < 192)
956 0 264 if ($offtype == 1) { }
0 264 elsif ($offtype == 2) { }
959 0 0 unless $io->seek($off1, 0)
961 0 0 if $io->read($data, $sz) != $sz
963 0 0 unless $io->seek($off2, 0)
968 0 0 unless $io->seek($offset, 1)
973 0 264 unless $io->seek($offset, 0)
976 237 27 if ($type eq 'string') { }
981 237 0 if ($numbytes > 0) { }
984 33 204 if $io->read($data, $numbytes) != $numbytes
999 204 0 if ($op eq '=') { }
0 0 elsif ($op eq '<') { }
0 0 elsif ($op eq '>') { }
1012 0 204 if ($self->check_magic)
1022 0 27 if $io->read($data, $numbytes) != $numbytes
1027 0 27 if (ref $template) { }
1037 6 21 if (defined $mask)
1043 24 3 if ($op eq '=') { }
0 3 elsif ($op eq 'x') { }
0 3 elsif ($op eq '!') { }
3 0 elsif ($op eq '&') { }
0 0 elsif ($op eq '^') { }
0 0 elsif ($op eq '<') { }
0 0 elsif ($op eq '>') { }
1072 0 27 if ($self->check_magic)
1078 3 228 if ($match)
1082 0 3 if ($message =~ s/^\\b//) { }
1084 0 0 index($message, '%s') != -1 ? :
1089 0 3 index($message, '%s') != -1 ? :
3 0 if $message
1109 0 0 if @$item == 3
1112 0 0 unless defined $item
1116 0 0 unless defined $str
1117 0 0 if $str eq ''
1120 0 0 unless defined $op
1129 0 0 if ($offtype == 1) { }
0 0 elsif ($offtype == 2) { }
1132 0 0 if length $str < $off1
1135 0 0 if length $str < $off2
1145 0 0 if $offset > length $str
1149 0 0 if ($type eq 'string') { }
1154 0 0 if ($numbytes > 0) { }
1165 0 0 if ($op eq '=') { }
0 0 elsif ($op eq '<') { }
0 0 elsif ($op eq '>') { }
1179 0 0 if ($self->check_magic)
1193 0 0 if (ref $template) { }
1203 0 0 if (defined $mask)
1209 0 0 if ($op eq '=') { }
0 0 elsif ($op eq 'x') { }
0 0 elsif ($op eq '!') { }
0 0 elsif ($op eq '&') { }
0 0 elsif ($op eq '^') { }
0 0 elsif ($op eq '<') { }
0 0 elsif ($op eq '>') { }
1238 0 0 if ($self->check_magic)
1244 0 0 if ($match)
1248 0 0 if ($message =~ s/^\\b//) { }
1255 0 0 if $message