Branch Coverage

blib/lib/Net/Google/SafeBrowsing4/Storage/File.pm
Criterion Covered Total %
branch 8 134 5.9


line true false branch
96 0 12 unless bless $self, $class
124 0 12 unless (-d $self->{'path'})
125 0 0 unless mkdir $self->{'path'}
130 1 11 if (not -e $file)
132 0 1 if ($self->{'sticky'})
136 0 1 unless nstore(\%update, $file)
144 0 0 unless $args{'add'}
145 0 0 unless $args{'remove'}
150 0 0 if $self->{'logger'}
153 0 0 if (-e $file and not $override)
155 0 0 if $self->{'logger'}
157 0 0 if $self->{'logger'}
158 0 0 if $self->{'logger'}
160 0 0 if $self->{'logger'}
162 0 0 if $self->{'logger'}
166 0 0 if $self->{'logger'}
171 0 0 unless nstore(\%data, $file)
172 0 0 if ($self->{'sticky'})
177 0 0 if $self->{'logger'}
190 0 0 if ($self->{'sticky'})
203 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->{'files'}{'updates'}}) { }
210 0 0 if $self->{'logger'}
212 0 0 if ($self->{'sticky'})
227 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->{'files'}{'updates'}}) { }
234 0 0 if $self->{'logger'}
236 0 0 if ($self->{'sticky'})
250 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->list_to_file($list)}) { }
255 0 0 if (not -e $file) { }
259 0 0 if $self->{'logger'}
262 0 0 if ($self->{'sticky'})
282 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->{'files'}{'updates'}}) { }
287 0 0 if $self->{'logger'}
295 0 0 unless nstore($update, $file)
297 0 0 if ($self->{'sticky'})
314 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->{'files'}{'updates'}}) { }
319 0 0 if $self->{'logger'}
327 0 0 unless nstore($update, $file)
328 0 0 if ($self->{'sticky'})
336 0 0 unless $args{'lists'}
337 0 0 unless $args{'hashes'}
340 0 0 if $self->{'logger'}
343 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->list_to_file($list)}) { }
348 0 0 unless (-e $file)
349 0 0 if $self->{'logger'}
353 0 0 if $self->{'logger'}
356 0 0 if ($self->{'sticky'})
364 0 0 if (defined $index)
377 0 0 unless $args{'hashes'}
383 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->{'files'}{'full_hashes'}}) { }
0 0 elsif (-e $file) { }
393 0 0 if $self->{'logger'}
399 0 0 if $self->{'logger'}
400 0 0 unless nstore($db, $file)
402 0 0 if ($self->{'sticky'})
412 0 0 unless $args{'lists'}
416 0 0 if ($self->{'sticky'} and exists $self->{'data'}{$self->{'files'}{'full_hashes'}}) { }
421 0 0 unless (-e $file)
425 0 0 if $self->{'logger'}
430 0 0 if $self->{'logger'}
438 0 0 if $_->{'hash'} eq $hash and $_->{'list'}{'threatEntryType'} eq $list->{'threatEntryType'} and $_->{'list'}{'threatType'} eq $list->{'threatType'} and $_->{'list'}{'platformType'} eq $list->{'platformType'}
440 0 0 if defined $result
457 0 0 if ($self->{'keep_all'} == 0)
462 0 0 unless (-e $file)
469 0 0 if (scalar @results < scalar @{$db->{'hashes'};})
471 0 0 unless nstore($db, $file)
483 0 1 unless (-e $file)
495 0 2 unless nstore($lists, $file)