Branch Coverage

blib/lib/Cache/CacheFactory.pm
Criterion Covered Total %
branch 73 144 50.6


line true false branch
48 0 11 ref $_[0] ? :
60 0 11 if exists $options{'default_expires_in'}
65 0 11 if exists $options{'positional_set'}
69 0 11 if defined $options{'last_auto_purge'}
73 0 11 if exists $options{'auto_purge_interval'}
76 0 11 if exists $options{'auto_purge_on_set_interval'}
79 0 11 if exists $options{'auto_purge_on_get_interval'}
83 0 11 if exists $options{'auto_purge_on_set'}
85 0 11 if exists $options{'auto_purge_on_get'}
89 0 11 if $options{'nonfatal_missing_policies'}
91 0 11 if $options{'nonwarning_missing_policies'}
95 1 10 if $options{'no_deep_clone'}
101 3 8 if $options{'pruning'}
103 2 9 if $options{'validity'}
105 0 11 if ($#{$$self{'policies'}{'storage'}{'order'};} == -1)
112 0 0 unless $$self{'nonwarning_missing_policies'}
131 0 103 if ($$self{'compat'}{'positional_set'} and $$self{'compat'}{'positional_set'} ne 'auto' || $_[0] ne 'key') { }
141 0 0 if (defined($next_arg = shift()))
144 0 0 if ($next_arg eq 'mode') { }
154 0 0 if defined($next_arg = shift()) and $next_arg eq 'mode'
158 0 103 ref $_[0] ? :
159 103 0 if (exists $$param{'key'}) { }
171 103 0 if (exists $$param{'data'}) { }
183 48 55 if (exists $$param{'mode'})
190 48 55 if ($mode)
192 18 30 if ($self->exists($key)) { }
194 9 9 if $mode eq 'add'
198 15 15 if $mode eq 'replace'
202 79 0 unless $$param{'created_at'}
203 4 75 if $$self{'no_deep_clone'}
215 4 75 if ($$param{'no_deep_clone'}) { }
226 4 0 if ($storage->isa('Cache::BaseCache'))
230 4 0 if ($backend = $storage->_get_backend)
264 66 79 unless defined($object = $storage->get_object($key))
268 7 4 if $$validity_policies{'drivers'}{$validity_policy}->is_valid($self, $storage, $object)
273 75 4 if defined $object
278 0 145 if $$self{'auto_purge_on_get'}
280 75 70 if defined $object
295 0 0 if defined $object
306 0 0 unless ($object->isa('Cache::CacheFactory::Object'))
311 0 0 if $$self{'no_deep_clone'}
340 0 60 if ($storage->can('exists')) { }
349 27 33 if $exists
352 27 33 $exists ? :
432 79 0 unless $$self{"auto_purge_on_$set_or_get"}
435 0 0 if $$self{'last_auto_purge'} >= time - $$self{"auto_purge_${set_or_get}_interval"}
462 1 3 if $driver->isa('Cache::FastMemoryCache')
498 1 3 if $driver->isa('Cache::NullCache')
559 0 0 unless ($time_pruning or $time_validity)
566 0 0 if $time_pruning
568 0 0 if $time_validity
580 0 0 unless ($time_pruning or $time_validity)
591 0 0 if $time_validity
592 0 0 if $time_pruning
602 0 0 unless ($size_policy)
616 0 0 $last_auto_purge eq 'now' ? :
719 14 2 unless ref $policies
724 2 0 if ref $policies eq 'HASH'
728 0 0 if (ref $policies eq 'ARRAY')
733 0 0 unless $#{$policies;} % 2
752 0 16 unless $policies
757 11 5 $policytype eq 'storage' ? :
765 0 0 if exists $$self{'compat'}{'default_expires_in'} and $$policies{'param'}{'time'} and not exists $$policies{'param'}{'time'}{'default_expires_in'}
777 11 5 if $policytype eq 'storage' and not exists $$param{'namespace'}
780 16 0 if ($driver) { }
790 0 0 if ($driver_module) { }
799 0 0 if ($$self{'nonfatal_missing_policies'}) { }
802 0 0 unless $$self{'nonwarning_missing_policies'}
849 62 28 unless $$self{'_last'}
863 148 0 unless $$self{'_last'}
921 1 2 $policytype eq 'storage' ? :
925 3 0 if $factoryclass->get_registered_class($policy)