Branch Coverage

blib/lib/Zeek/Log/Parse.pm
Criterion Covered Total %
branch 37 50 74.0


line true false branch
43 1 10 if (not defined $arg) { }
5 5 elsif (ref $arg eq 'HASH') { }
1 4 elsif (defined &openhandle($arg)) { }
55 6 5 if (defined $self->{'file'} and not defined $self->{'fh'})
56 0 6 unless (-f $self->{'file'})
61 0 6 unless &Zeek::Log::Parse::open(my $fh, '<', $self->{'file'})
65 1 2 unless (defined $self->{'fh'} or defined $self->{'diamond'} and $self->{'diamond'})
88 10 70 if ($firstline)
90 0 10 if (length $line > 1 and substr($line, 0, 1) eq '{')
92 0 0 unless $json
95 0 0 if (not defined $val or ref $val ne 'HASH')
107 0 80 unless ($line =~ /^#/)
112 10 70 if ('#fields' eq $type) { }
10 60 elsif ('#types' eq $type) { }
137 0 31 if ($self->{'json_file'})
139 0 0 if (not defined $val or ref $val ne 'HASH')
148 12 19 if ($line =~ /^#/)
149 1 11 if ('#fields' eq shift @fields)
161 1 18 unless (scalar @names == scalar @fields)
162 1 0 if $removed == 0
168 90 270 if ($field eq '-') { }
14 256 elsif ($field eq '(empty)') { }
171 1 13 $self->{'empty_as_undef'} ? :
184 0 115 if (defined $self->{'saved_line'})
192 94 21 defined $in ? :