lib/Mail/DMARC/Report/Store.pm

filter: Statementstmt 94.8% 37 / 39 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 92.8% 13 / 14 Podpod 0.0% 0 / 6 totaltotal 84.1% 53 / 63 CC 3 SCAR 3.7
CC
3
Cov
93%
backend
3.0
retrieve
2.0
BEGIN
1.0
CRAP 1.4
« lib/Mail/DMARC/Report/Store/SQL/Grammars/SQLite.pm ↑ Summary lib/Mail/DMARC/Test/Transport.pm »
1 package Mail::DMARC::Report::Store;
2 6 our $VERSION = '2.20261110';
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use feature 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use feature 'try';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶no warnings 'experimental::try'; ## no critic (ProhibitNoWarnings)
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use Module::Load;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 6 ▶use parent 'Mail::DMARC::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 10 ▶sub delete_report( $self, @args ) {
Subroutine delete_report: called CC=1 SCAR=0.0
Pod undocumented
15 10 return $self->backend->delete_report(@args);
16 }
17  
18 4 ▶sub error( $self, @args ) {
Subroutine error: called CC=1 SCAR=0.0
Pod undocumented
19 4 return $self->backend->insert_error(@args);
20 }
21  
22 0 ▶sub retrieve( $self, @args ) {
Subroutine retrieve: not called CC=1 SCAR=6.9
Pod undocumented
23 0 return $self->backend->retrieve(@args);
24 }
25  
26 21 ▶sub next_todo( $self, @args ) {
Subroutine next_todo: called CC=1 SCAR=0.0
Pod undocumented
27 21 return $self->backend->next_todo(@args);
28 }
29  
30 1 ▶sub retrieve_todo( $self, @args ) {
Subroutine retrieve_todo: called CC=1 SCAR=0.0
Pod undocumented
31 1 return $self->backend->retrieve_todo(@args);
32 }
33  
34 56 ▶sub backend($self) {
Subroutine backend: called CC=3 SCAR=11.1
Pod undocumented
35 56 my $backend = $self->config->{report_store}{backend};
36  
37 56 ▶ croak "no backend defined?!" if !$backend;
Branch: 1 branch
BranchTrueFalseTotal
unless $backend 0 56 56
38  
39 56 ▶ return $self->{$backend} if ref $self->{$backend};
Branch: 1 branch
BranchTrueFalseTotal
if ref $self->{$backend} 29 27 56
40 27 my $module = "Mail::DMARC::Report::Store::$backend";
41 27 try {
42 27 load $module;
43 }
44 catch ($error) {
45 0 croak "Unable to load backend $backend: $error\n";
46 }
47  
48 27 return $self->{$backend} = $module->new;
49 }
50  
51 6 1;
52  
53 __END__
« lib/Mail/DMARC/Report/Store/SQL/Grammars/SQLite.pm ↑ Summary lib/Mail/DMARC/Test/Transport.pm »