Memcached/Base.pm

filter: Statementstmt 70.2% 26 / 37 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 2 totaltotal 53.3% 32 / 60 CC 5 SCAR 20.4
CC
5
Cov
57%
BUILD
20.0
fetch_multi_hashref
6.0
_build_contained_cache
2.0
CRAP 7.7
↑ Summary Memcached/t/CHIDriverTests/Base.pm »
1 package CHI::Driver::Memcached::Base;
2 2 $CHI::Driver::Memcached::Base::VERSION = '0.16';
3 2 ▶use CHI;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Class::Load;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 has 'memd' => ( is => 'ro', init_arg => undef );
11 2 has 'memd_class' => ( is => 'ro' );
12 2 has 'memd_params' => ( is => 'ro' );
13  
14 2 extends 'CHI::Driver::Base::CacheContainer';
15  
16 # Unsupported methods
17 #
18 2 __PACKAGE__->declare_unsupported_methods(
19 qw(dump_as_hash get_keys get_namespaces is_empty clear purge));
20  
21 2 __PACKAGE__->meta->make_immutable();
22  
23 0 ▶sub BUILD {
Subroutine BUILD: not called CC=4 SCAR=30.0
Pod undocumented
24 0 my ( $self, $params ) = @_;
25  
26 0 ▶ $self->{memd_params} ||= $self->non_common_constructor_params($params);
Condition0%0/3
$self->{"memd_params"} ||= $self->non_common_constructor_params($params)
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"memd_params"} ||= $self->non_common_constructor_params($params)
$self->{"memd_params"} $self->non_common_constructor_params($params)
Truth table0%0/3
A ||= B
A= $self->{"memd_params"}B= $self->non_common_constructor_params($params)
ABresult
1X1
011
000
27 0 ▶ $self->{memd_params}->{namespace} ||= $self->{namespace} . ":";
Condition0%0/2
$self->{"memd_params"}{"namespace"} ||= $self->{"namespace"} . ':'
l!l
00
MC/DC0%0/1
$self->{"memd_params"}{"namespace"} ||= $self->{"namespace"} . ':'
$self->{"memd_params"}{"namespace"}
Truth table0%0/2
A
A= $self->{"memd_params"}{"namespace"}
Aresult
11
00
28 0 $self->{memd} = $self->{_contained_cache} = $self->_build_contained_cache;
29 $self->{max_key_length} = 248 - length( $self->{namespace} )
30 0 ▶ if !defined( $self->{max_key_length} );
Branch: 1 branch
BranchTrueFalseTotal
if not defined $self->{"max_key_length"} 0 0 0
31 }
32  
33 0 ▶sub _build_contained_cache {
Subroutine _build_contained_cache: not called CC=1 SCAR=6.9
34 0 my ($self) = @_;
35  
36 0 Class::Load::load_class( $self->memd_class );
37 0 return $self->memd_class->new( $self->memd_params );
38 }
39  
40 # Memcached supports fast multiple get
41 #
42  
43 0 ▶sub fetch_multi_hashref {
Subroutine fetch_multi_hashref: not called CC=2 SCAR=17.9
Pod undocumented
44 0 my ( $self, $keys ) = @_;
45 0 ▶ croak "must specify keys" unless defined($keys);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $keys 0 0 0
46  
47 0 return $self->memd->get_multi(@$keys);
48 }
49  
50 2 1;
↑ Summary Memcached/t/CHIDriverTests/Base.pm »