Branch Coverage

blib/lib/Cookie/Domain.pm
Criterion Covered Total %
branch 79 188 42.0


line true false branch
59 0 11 unless $self->SUPER::init(@_)
60 11 0 unless ($self->{'no_load'})
62 0 11 unless $self->load
77 0 0 if (scalar @_ and ref $_[0] eq 'Cookie::Domain' || $_[0] eq 'Cookie::Domain')
81 0 0 if (@_ == 1 and ref $_[0] eq 'HASH') { }
0 0 elsif (not scalar(@_) % 2) { }
90 0 0 if (ref $this) { }
101 0 0 $self->_is_a($file, 'Module::Generic::File') ? :
111 0 0 $file->exists && !$file->is_empty ? :
0 0 $meta->{'db_last_modified'} ? :
115 0 0 if ($meta->{'etag'} and $file->exists and not $file->is_empty) { }
0 0 elsif (not $meta->{'etag'}) { }
124 0 0 if (defined $mtime and $mtime)
127 0 0 if ($dt)
147 0 0 if ($@)
157 0 0 if ($@)
171 0 0 if ($@)
176 0 0 if ($last_mod) { }
185 0 0 if ($resp->header("etag"))
187 0 0 $resp->header('etag') eq ($meta->{'etag'} // '') ? :
192 0 0 if ($code == 304 or not $file->is_empty and $mtime and $mtime == $epoch) { }
0 0 elsif ($code ne 200) { }
0 0 elsif (not length $data) { }
195 0 0 unless ($self->suffixes->length)
197 0 0 unless $self->load_public_suffix
200 0 0 if ($dont_have_etag and $meta->{'etag'})
202 0 0 unless $self->save_as_json
214 0 0 unless $file->unload_utf8($data, {"lock", 1})
217 0 0 unless $self->load_public_suffix
218 0 0 unless $self->save_as_json
227 0 0 unless length $name
234 0 0 if ($@)
245 0 0 unless length $name
252 0 0 if ($@)
268 9 2 if (defined $Cookie::Domain::PUBLIC_SUFFIX_DATA and ref $Cookie::Domain::PUBLIC_SUFFIX_DATA eq 'HASH') { }
1 1 elsif ($json_file and $json_file->exists) { }
275 0 1 unless $self->load_json($json_file)
277 1 0 if ($f and $f->exists)
279 1 0 if (defined $meta->{'db_last_modified'} and $meta->{'db_last_modified'} =~ /^\d{10}$/) { }
282 0 1 if ($mtime > $meta->{'db_last_modified'})
284 0 0 unless $self->load_public_suffix($f)
285 0 0 unless $self->save_as_json($json_file)
290 0 0 unless $self->load_public_suffix($f)
291 0 0 unless $self->save_as_json($json_file)
297 0 0 unless $json_file or $f
298 0 1 unless $self->load_public_suffix($f)
299 0 1 unless $self->save_as_json($json_file)
308 1 0 $self->_is_a($file, 'Module::Generic::File') ? :
310 0 1 if (not $file->exists) { }
0 1 elsif (not $file->can_read) { }
0 1 elsif ($file->is_empty) { }
323 0 1 unless defined $json
324 0 1 unless length $json
332 0 1 if ($@)
336 1 0 if (ref $ref->{'suffixes'} eq "HASH")
341 1 0 if ref $ref->{'meta'} ne "HASH"
350 1 0 $self->_is_a($file, 'Module::Generic::File') ? :
352 0 1 if (not $file->exists) { }
0 1 elsif (not $file->can_read) { }
0 1 elsif ($file->is_empty) { }
364 0 1 unless $file->open("<", {"binmode", "utf-8"})
372 5847 9105 unless length $l
374 461 8644 unless ($l =~ /^[\x00-\x7f]*$/)
383 0 461 if ($@)
395 8 9097 if $is_neg
396 461 8644 if defined $orig
415 1 0 $self->_is_a($file, 'Module::Generic::File') ? :
426 0 1 if ($@)
444 1 0 $self->file && $self->file->exists ? :
0 1 $meta->{'etag'} ? :
454 0 1 if ($@)
458 0 1 unless $file->unload_utf8($json)
468 82 13 unless exists $opts->{'min_suffix'}
471 12 83 if (not $name =~ /^[\x00-\x7f]*$/) { }
484 0 95 unless $name =~ /$Cookie::Domain::DOMAIN_RE/
499 121 80 if (my $public_label_def = $def->{$label}) { }
8 72 elsif (exists $def->{'*'}) { }
503 4 117 if (exists $public_label_def->{'_is_neg'} and $public_label_def->{'_is_neg'}) { }
516 0 8 if (exists $public_label_def->{'_is_neg'} and $public_label_def->{'_is_neg'}) { }
529 129 72 if (@$buff)
534 0 129 if @$buff
542 72 0 unless scalar @$stack
551 4 91 if scalar keys %$expt
556 10 85 unless defined $len
557 13 82 if $opts->{'add'}
560 71 24 if ($len < $labels->length) { }
24 0 elsif ($len > 0) { }
573 10 85 unless ($suffix->length)
575 0 10 if (want('OBJECT')) { }
586 33 52 if $labels->length
587 12 73 if (defined $idn)
590 10 2 if defined $name
591 2 10 if defined $sub
614 0 15 unless ($self->name->length and $self->suffix->length)