Branch Coverage

blib/lib/CGI/Session.pm
Criterion Covered Total %
branch 95 148 64.1


line true false branch
21 12 6 unless @_
33 1 25 if (ref $class) { }
45 3 22 unless defined($self = $class->load(@_))
56 18 5 unless ($$self{'_DATA'}{'_SESSION_ID'})
58 0 18 unless (defined $$self{'_DATA'}{'_SESSION_ID'})
80 102 5 defined $_[0]->dataref ? :
82 6 0 defined $_[0]->dataref ? :
84 6 0 defined $_[0]->dataref ? :
88 16 24 if defined $$self{'_OBJECTS'}{'driver'}
95 9 23 if defined $$self{'_OBJECTS'}{'serializer'}
102 0 18 if defined $$self{'_OBJECTS'}{'id'}
117 0 25 unless $dsn_str
129 4 15 if ($$self{'_QUERY'})
139 32 0 unless (defined $_[1])
158 0 72 unless @_
165 0 25 unless @_
182 8 35 unless $self->id
183 9 26 if $$self{'_STATUS'} == 0
185 6 20 if ($self->_test_status(1) and $self->_test_status(4))
193 6 14 if ($self->_test_status(4))
194 0 6 unless defined $driver->remove($self->id)
201 13 1 if ($self->_test_status(1) or $self->_test_status(2))
203 0 13 unless (defined $datastr)
206 0 13 unless defined $driver->store($self->id, $datastr)
219 0 91 if $self->_test_status(4)
224 5 86 unless (@_)
231 63 23 if @_ == 1
243 6 17 if (defined $args{'-name'} and defined $args{'-value'})
244 0 6 if ($args{'-name'} =~ /^_SESSION_/)
255 4 13 if defined $args{'-name'}
260 13 0 unless (@_ % 2)
262 0 21 if ($_[$i] =~ /^_SESSION_/)
295 0 2 if ($self->is_expired) { }
0 2 elsif (my $t = $self->expire) { }
318 0 0 unless my(@values) = $query->param($p)
319 0 0 if (@values > 1) { }
347 0 0 if (defined $params) { }
348 0 0 unless ref $params
365 0 0 if (@_ == 1) { }
371 0 0 unless ($coderef and ref $coderef and ref $coderef eq 'CODE')
376 0 0 if ($dsnstr)
383 0 0 if (my $errmsg = $@)
388 0 0 unless ($driver_obj)
395 0 0 unless ($session)
401 0 0 unless defined $driver_obj->traverse($driver_coderef)
574 1 33 if ref $class
575 1 32 if @_ > 3
601 1 31 if (@_ == 1)
602 0 1 if (ref $_[0]) { }
607 23 9 if (@_ > 1)
608 21 2 if (defined $_[0])
613 0 23 if (ref $_[1]) { }
619 23 9 if (@_ == 3)
640 0 96 if (my $errmsg = $@)
645 15 17 unless ($$self{'_CLAIMED_ID'})
650 0 15 if (my $errmsg = $@)
657 15 17 unless $$self{'_CLAIMED_ID'}
663 0 17 unless (defined $raw_data)
668 5 12 unless $raw_data
672 5 7 unless (defined $$self{'_DATA'})
677 0 7 unless (defined $$self{'_DATA'} and ref $$self{'_DATA'} and ref $$self{'_DATA'} eq 'HASH' and defined $$self{'_DATA'}{'_SESSION_ID'})
684 0 7 if ($CGI::Session::IP_MATCH)
685 0 0 unless ($self->_ip_matches)
694 3 4 if ($$self{'_DATA'}{'_SESSION_ETIME'})
695 1 2 if ($$self{'_DATA'}{'_SESSION_ATIME'} + $$self{'_DATA'}{'_SESSION_ETIME'} <= time)
706 0 0 if ($$self{'_DATA'}{'_SESSION_ATIME'} + $max_exp_interval <= time)
710 0 6 if @expired_params
840 25 15 if (not @_) { }
13 2 elsif (@_ == 1) { }
847 1 12 if (defined $time and $time =~ /^\d$/ and $time == 0) { }
861 1 1 if ($time =~ /^\d$/ and $time == 0) { }
887 0 22 unless defined $str
888 3 19 if $str =~ /^[-+]?\d+$/
901 0 19 unless (defined $koef and defined $d)