Branch Coverage

blib/lib/Net/Google/SafeBrowsing2.pm
Criterion Covered Total %
branch 16 202 7.9


line true false branch
227 1 0 unless (exists $self->{'storage'})
231 0 1 if (ref $self->{'list'} ne 'ARRAY')
235 0 1 unless bless $self, $class
290 0 0 if defined $list
301 0 0 if ($info->{'time'} + $info->{'wait'} > time and $force == 0) { }
311 0 0 if (scalar @lists == 0)
321 0 0 if ($mac)
324 0 0 if ($client_key eq '' or $wrapped_key eq '')
334 0 0 if $mac
345 0 0 if ($a_range ne '')
348 0 0 if ($s_range ne '')
349 0 0 if $a_range ne ''
354 0 0 if $mac
363 0 0 if $self->{'debug'}
364 0 0 if $self->{'debug'}
367 0 0 unless ($res->is_success)
388 0 0 if ($line =~ /n:\s*(\d+)\s*$/) { }
0 0 elsif ($line =~ /i:\s*(\S+)\s*$/) { }
0 0 elsif ($line =~ /u:\s*(\S+),(\S+)\s*$/) { }
0 0 elsif ($line =~ /u:\s*(\S+)\s*$/) { }
0 0 elsif ($line =~ /ad:(\S+)$/) { }
0 0 elsif ($line =~ /sd:(\S+)$/) { }
0 0 elsif ($line =~ /m:(\S+)$/ and $mac) { }
0 0 elsif ($line =~ /e:pleaserekey/ and $mac) { }
0 0 elsif ($line =~ /r:pleasereset/) { }
437 0 0 unless ($self->validate_data_mac('data', $data, 'key', $client_key, 'digest', $hmac))
460 0 0 if scalar @redirections > 0
471 0 0 unless ($res->is_success)
481 0 0 if $self->{'debug'}
482 0 0 if $self->{'debug'}
485 0 0 if ($mac and not $self->validate_data_mac('data', $data, 'key', $client_key, 'digest', $hmac))
493 0 0 if ($result != 1)
580 0 0 if $list ne ''
601 0 0 if $match ne ''
644 0 0 if (defined $message) { }
681 0 0 if (scalar @add_chunks == 0)
698 0 0 if ($hash eq $full_hash and defined &first(sub { $add_chunk->{'list'} eq $_; } , @$lists))
707 0 0 if $found ne ''
709 0 0 if $found ne ''
712 0 0 if $found ne ''
722 0 0 unless defined $hash
726 0 0 if (defined $hash and defined $list)
761 0 0 if (scalar @add_chunks == 0)
769 0 0 if (scalar @full_hashes_prefix == 0)
771 0 0 if scalar @full_hashes == 0
779 0 0 if ($add_chunks[$i]{'prefix'} ne '') { }
782 0 0 if ($add_chunks[$i]{'prefix'} eq $hash_prefix)
791 0 0 if ($found == 0) { }
803 0 0 if (scalar @add_chunks == 0)
817 0 0 if ($add_chunk->{'chunknum'} != $sub_chunk->{'addchunknum'} or $add_chunk->{'list'} ne $sub_chunk->{'list'})
822 0 0 if ($sub_chunk->{'prefix'} eq $add_chunk->{'prefix'}) { }
831 0 0 if (scalar @add_chunks == 0)
867 0 0 if $list ne ''
889 0 0 if scalar @matches > 0
907 0 0 if ($keys->{'client_key'} eq '' or $keys->{'wrapped_key'} eq '')
936 0 0 unless ($res->is_success)
944 0 0 if ($data =~ s/^clientkey:(\d+)://im)
952 0 0 if ($data =~ s/^wrappedkey:(\d+)://im) { }
1005 0 0 unless exists $info->{'errors'}
1009 0 0 $errors > 5 ? :
0 0 $errors == 5 ? :
0 0 $errors == 4 ? :
0 0 $errors == 3 ? :
0 0 $errors == 2 ? :
0 0 $errors == 1 ? :
1037 0 0 if ($chunk->{'host'} eq $suffix and $chunk->{'prefix'} eq $prefix || $chunk->{'prefix'} eq '' and $chunk->{'add_chunknum'} == $chuknum)
1056 0 0 unless (exists $self->{'ua'})
1088 0 0 if ($data =~ /^(\d+):(\d+):(\d+)\n/sig) { }
1101 0 0 if ($type eq 's:') { }
0 0 elsif ($type eq 'a:') { }
1152 0 0 if ($count == 0) { }
1159 0 0 if ($self->{'debug'})
1175 0 0 if ($self->{'debug'})
1209 0 0 if ($count > 0) { }
1216 0 0 if ($self->{'debug'})
1224 0 0 if ($self->{'debug'})
1282 0 0 if $self->{'debug'} > 0
1295 0 0 if $self->{'debug'} > 0 or $self->{'errors'} > 0
1309 0 0 if $self->{'perf'} > 0
1323 0 3 if ($domain =~ /^\d+\.\d+\.\d+\.\d+$/)
1328 2 1 if (scalar @parts >= 3)
1354 0 3 if ($domain =~ /^\d+\.\d+\.\d+\.\d+$/)
1381 1 2 if ($path =~ /\?/)
1446 3 36 if (not $uri->scheme or $uri->scheme eq '')
1468 2 37 if $escape =~ m[^[a-z]+://[^/\?]+$]
1473 3 36 if ((my $domain = 'URI'->new($escape)->host) =~ /^\d+$/)
1517 0 39 if ($exception and $escape =~ m[^[a-z]+://[^/]+/(.+)])
1591 0 0 if (time - $errors->{'timestamp'} < $time) { }
1603 0 0 if (defined $errors and $errors->{'errors'} > 2) { }
1605 0 0 $errors->{'errors'} == 4 ? :
0 0 $errors->{'errors'} == 3 ? :
1624 0 0 if (not $res->is_success) { }
1630 0 0 if (defined $errors and $errors->{'errors'} >= 2 || $errors->{'errors'} == 1 && time - $errors->{'timestamp'} > 300)
1667 0 0 unless ($data =~ /^[a-z-]+:\d+:\d+\n/)
1732 0 0 if scalar @$numbers == 0
1739 0 0 if ($numbers->[$i] != $$numbers[$i - 1] + 1) { }
0 0 elsif ($new_range == 0) { }
1740 0 0 if $i > 1 and $new_range == 1
1750 0 0 if $new_range == 1
1769 0 0 if ($data =~ /^\d+$/) { }
0 0 elsif ($data =~ /^(\d+)-(\d+)$/) { }