Branch Coverage

blib/lib/Cookie.pm
Criterion Covered Total %
branch 76 206 36.8


line true false branch
85 1 45 unless $self->SUPER::init(@_)
95 0 0 if (@_)
98 0 0 if (defined $algo and length $algo) { }
100 0 0 unless $self->_load_class("Crypt::Mode::CBC", {"version", "0.074"})
112 0 0 if ($@)
129 0 15 unless scalar keys %$hash
130 0 14 if (not defined $Cookie::SUBS or ref $Cookie::SUBS ne "ARRAY" or not scalar @$Cookie::SUBS)
142 12 588 if ($_ eq "version" and not length $hash->{$_})
148 107 481 if (exists $hash->{$_})
150 30 77 if (not defined $hash->{$_}) { }
182 0 0 if $self->{'_cache_value'} and not length $self->{'_reset'} and not $opts->{'is_request'}
184 0 38 unless defined $name and length $name
185 0 38 if ($name =~ /[^a-zA-Z\-\.\_\~]/)
191 0 38 if ($self->sign or $self->encrypt)
195 0 0 if ($self->sign->is_true) { }
0 0 elsif ($self->encrypt) { }
197 0 0 unless $self->_load_class("Crypt::Mac::HMAC", {"version", "0.074"})
204 0 0 if ($@)
206 0 0 $self->sign ? :
212 0 0 unless $self->_load_class("Crypt::Misc", {"version", "0.074"})
223 0 0 if ($@)
225 0 0 $self->sign ? :
232 38 0 if (length $value)
235 0 38 if ($value =~ /^\"([^\"]+)\"$/)
241 0 38 if $wrapped_in_double_quotes
244 10 28 if $opts->{'is_request'}
245 0 28 if $self->domain
246 0 28 if $self->port
247 6 22 if $self->path
249 14 14 if (my $t = $self->expires and not $self->max_age->length)
257 2 26 if length $self->max_age
258 3 25 if ($self->same_site->defined and $self->same_site =~ /^(?:lax|strict|none)/i)
262 1 27 if $self->secure
263 1 27 if $self->http_only
285 0 0 unless $value->length
291 0 0 unless defined $key and length "$key"
292 0 0 unless defined $algo and length "$algo"
293 0 0 unless $self->_load_class("Crypt::Misc", {"version", "0.074"})
304 0 0 if ($@)
332 21 61 if (@_)
345 0 21 if ($@)
351 1 20 if (not defined $exp) { }
3 17 elsif ($exp =~ /^\d{1,10}$/) { }
2 15 elsif ($self->_is_object($exp) and $exp->isa('DateTime') || $exp->isa('Module::Generic::Datetime')) { }
9 6 elsif ($exp =~ /^([\+\-]?\d+)([YyMDdhms])?$/) { }
1 5 elsif (lc $exp eq 'now') { }
5 0 elsif (defined $exp and length $exp) { }
370 0 3 if ($@)
382 2 7 unless length $unit
405 0 5 unless defined $dt
406 1 4 unless length $dt
413 19 1 if (defined $dt)
415 19 0 if $self->_is_a($dt, "DateTime")
416 0 19 $dt->isa('Module::Generic::DateTime') ? :
442 0 0 unless defined $exp or defined $max_age
443 0 0 if (defined $exp and not $self->_is_a($exp, "Module::Generic::DateTime") and not $self->_is_a($exp, "DateTime") or defined $max_age and not $max_age =~ /\-?\d+$/)
449 0 0 if (defined $max_age and $max_age <= 0 or defined $exp and $exp < $now) { }
465 0 0 defined $self->expires || defined $self->max_age ? :
475 0 0 unless $self->sign or length $opts->{'key'}
476 0 0 if not $self->key->length || exists $opts->{'key'} or exists $opts->{'key'} and not length $opts->{'key'}
478 0 0 unless $value->length
479 0 0 if ($value->index(".") == -1)
482 0 0 if warnings::enabled()
491 0 0 unless $self->_load_class("Crypt::Mac::HMAC", {"version", "0.074"})
498 0 0 if ($@)
519 0 0 if $host eq $dom
522 0 0 if length $dom > length $host
525 0 0 unless ($self->implicit)
527 0 0 $host =~ /\.$dom$/ ? :
536 2 58 if (@_)
540 0 2 if (not defined $v) { }
546 0 2 unless $v =~ /^\-?\d+$/
551 1 1 if ($v <= 0) { }
574 0 1 if ($@)
593 44 116 if (@_)
598 0 44 if ($name =~ m#[\(\)\<\>\@\,\;\:\\\"/\[\]\?\=\{\}]# and $self->strict)
602 0 44 if ($name =~ s/^__Secure\-//) { }
0 44 elsif ($name =~ s/^__Host\-//) { }
609 0 0 unless $self->path->length
623 45 0 if not length $self->{'_reset'} and scalar @_
631 0 3 unless $this and $self->_is_object($this)
637 0 45 unless $code
639 0 24 if (not defined $v and defined $v2 or defined $v and not defined $v2 or defined $v and length "$v" != length "$v2" or defined $v and defined $v2 and "$v" ne "$v2")
663 0 0 if (@_) { }
0 0 elsif ($self->domain) { }
673 0 0 $self->secure ? :
0 0 $self->port ? :
0 0 $self->path ? :
692 0 0 unless defined $key and length "$key"
693 0 0 unless defined $algo and length "$algo"
696 0 0 unless $self->_load_class("Crypt::Mode::CBC", {"version", "0.074"})
697 0 0 unless $self->_load_class("Bytes::Random::Secure")
702 0 0 if ($@)
706 0 0 unless $crypt
708 0 0 unless $self->_load_class($class)
711 0 0 if length $key < $key_len
714 0 0 if (defined $iv and length "$iv") { }
716 0 0 if (length "$iv" != $block_len)
727 0 0 if ($@)
743 19 0 if (@_)
745 0 19 unless $self->_is_object($_[0])
746 0 19 unless $_[0]->isa("DateTime")
749 0 19 unless defined $dt