AnyCache/Backend.pm

filter: Statementstmt 77.4% 24 / 31 Branchbran 66.6% 4 / 6 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 36.3% 4 / 11 Podpod 0.0% 0 / 6 totaltotal 59.3% 38 / 64 CC 6 SCAR 11.9
CC
6
Cov
74%
get_serialiser
6.2
get
2.0
set
2.0
CRAP 3.3
« AnyCache/Serialiser/MessagePack.pm ↑ Summary ManyCache.pm »
1 package MojoX::Plugin::AnyCache::Backend;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Mojo::Base '-base';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 has 'config';
8 0 ▶has 'support_sync' => sub { 0 };
Subroutine __ANON__: not called CC=1 SCAR=1.2
9 0 ▶has 'support_async' => sub { 0 };
Subroutine __ANON__: not called CC=1 SCAR=1.2
10 5 has 'serialiser';
11  
12 70 ▶sub get_serialiser {
Subroutine get_serialiser: called CC=6 SCAR=18.3
Pod undocumented
13 70 my ($self) = @_;
14 70 ▶ if(!$self->serialiser && (my $s = $self->config->{serialiser})) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->serialiser and my $s = $self->config->{"serialiser"}) 6 64 70
Condition100%3/3
not $self->serialiser and my $s = $self->config->{"serialiser"}
!ll&&!rl&&r
26386
MC/DC100%2/2
not $self->serialiser and my $s = $self->config->{"serialiser"}
not $self->serialiser my $s = $self->config->{"serialiser"}
Truth table100%3/3
not(A) and B
A= not $self->serialiserB= my $s = $self->config->{"serialiser"}
ABresult
0X0
100
111
15 6 eval {
16 6 eval "require $s;";
17 6 ▶ warn("Require failed: $@") if $self->config->{debug} && $@;
Branch: 1 branch
BranchTrueFalseTotal
if $self->config->{"debug"} and $@ 0 6 6
Condition33%1/3
$self->config->{"debug"} and $@
!ll&&!rl&&r
600
MC/DC0%0/2
$self->config->{"debug"} and $@
$self->config->{"debug"} $@
Truth table33%1/3
A and B
A= $self->config->{"debug"}B= $@
ABresult
0X0
100
111
18 6 my $serialiser = $self->config->{serialiser}->new;
19 6 $serialiser->config($self->config);
20 6 $self->serialiser($serialiser);
21 };
22 6 ▶ die("Failed to load serialiser $s: $@") if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 6 6
23 }
24 70 return $self->serialiser;
25 }
26  
27 0 ▶sub get { die("Must be overridden in backend module") };
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
28 0 ▶sub set { die("Must be overridden in backend module") };
Subroutine set: not called CC=1 SCAR=6.9
Pod undocumented
29 0 ▶sub incr { die("Must be overridden in backend module") };
Subroutine incr: not called CC=1 SCAR=6.9
Pod undocumented
30 0 ▶sub decr { die("Must be overridden in backend module") };
Subroutine decr: not called CC=1 SCAR=6.9
Pod undocumented
31 0 ▶sub del { die("Must be overridden in backend module") };
Subroutine del: not called CC=1 SCAR=6.9
Pod undocumented
32  
33 5 1;
« AnyCache/Serialiser/MessagePack.pm ↑ Summary ManyCache.pm »