Brackup/DigestCache.pm

filter: Statementstmt 81.8% 18 / 22 Branchbran n/a Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 6 / 10 Podpod 0.0% 0 / 8 totaltotal 56.5% 26 / 46 CC 3 SCAR 6.1
CC
3
Cov
77%
new
3.0
default_filename
2.0
each
2.0
CRAP 1.8
« Brackup/Dict/Null.pm ↑ Summary Brackup/TargetBackupStatInfo.pm »
1 package Brackup::DigestCache;
2 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 5 ▶sub new {
Subroutine new: called CC=3 SCAR=11.1
Pod undocumented
6 5 my ($class, $root, $rconf) = @_;
7 5 my $self = bless {}, $class;
8  
9 5 ▶ my $file = $rconf->value('digestdb_file') ||
Condition50%1/2
$rconf->value('digestdb_file') || $root->path . '/' . default_filename()
l!l
50
MC/DC0%0/1
$rconf->value('digestdb_file') || $root->path . '/' . default_filename()
$rconf->value('digestdb_file')
Truth table50%1/2
A
A= $rconf->value('digestdb_file')
Aresult
11
00
10 ($root->path . '/' . default_filename());
11 5 ▶ my $type = $rconf->value('digestdb_type') || 'SQLite';
Condition50%1/2
$rconf->value('digestdb_type') || 'SQLite'
l!l
05
MC/DC0%0/1
$rconf->value('digestdb_type') || 'SQLite'
$rconf->value('digestdb_type')
Truth table50%1/2
A
A= $rconf->value('digestdb_type')
Aresult
11
00
12  
13 5 my $dict_class = "Brackup::Dict::$type";
14 5 eval "require $dict_class";
15 5 $self->{dict} = $dict_class->new(
16 table => "digest_cache",
17 file => $file,
18 );
19  
20 5 return $self;
21 }
22  
23 0 ▶sub default_filename { ".brackup-digest.db" };
Subroutine default_filename: not called CC=1 SCAR=6.9
Pod undocumented
24  
25 # proxy through to underlying dictionary
26 126 ▶sub get { shift->{dict}->get(@_) }
Subroutine get: called CC=1 SCAR=0.0
Pod undocumented
27 78 ▶sub set { shift->{dict}->set(@_) }
Subroutine set: called CC=1 SCAR=0.0
Pod undocumented
28 0 ▶sub each { shift->{dict}->each(@_) }
Subroutine each: not called CC=1 SCAR=6.9
Pod undocumented
29 0 ▶sub delete { shift->{dict}->delete(@_) }
Subroutine delete: not called CC=1 SCAR=6.9
Pod undocumented
30 0 ▶sub count { shift->{dict}->count(@_) }
Subroutine count: not called CC=1 SCAR=6.9
Pod undocumented
31 5 ▶sub backing_file { shift->{dict}->backing_file(@_) }
Subroutine backing_file: called CC=1 SCAR=0.0
Pod undocumented
32  
33 13 1;
34  
35 __END__
« Brackup/Dict/Null.pm ↑ Summary Brackup/TargetBackupStatInfo.pm »