Mail/Qmail/Filter/Dump.pm

filter: Statementstmt 60.0% 12 / 20 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 42.1% 16 / 38 CC 4 SCAR 24.7
CC
4
Cov
40%
filter
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
« Mail/Qmail/Filter/Util.pm ↑ Summary Mail/Qmail/Filter/LogEnvelope.pm »
1 1 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Mail::Qmail::Filter::Dump;
5  
6 1 our $VERSION = '1.01';
7  
8 1 ▶use Mo qw(coerce required);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 extends 'Mail::Qmail::Filter';
10  
11 1 has 'to' => required => 1;
12  
13 0 ▶sub filter {
Subroutine filter: not called CC=4 SCAR=30.0
Pod documented
14 0 my $self = shift;
15 0 my $message = $self->message;
16 0 ▶ require Path::Tiny and Path::Tiny->import('path')
Branch: 1 branch
BranchTrueFalseTotal
unless defined &Mail::Qmail::Filter::Dump::path 0 0 0
Condition0%0/6
defined &Mail::Qmail::Filter::Dump::path || require Path::Tiny && 'Path::Tiny'->import('path')
l!l&&r!l&&!r
000
require Path::Tiny and "Path::Tiny"->import("path")
!ll&&!rl&&r
000
MC/DC0%0/3
defined &Mail::Qmail::Filter::Dump::path || require Path::Tiny && 'Path::Tiny'->import('path')
defined &Mail::Qmail::Filter::Dump::path require Path::Tiny "Path::Tiny"->import("path")
Truth table0%0/4
A || B and C
A= defined &Mail::Qmail::Filter::Dump::pathB= require Path::TinyC= "Path::Tiny"->import("path")
ABCresult
1XX1
0111
00X0
0100
17 unless defined &path;
18 0 my $dest = path( $self->to );
19 0 state $i = 0;
20 0 ▶ $dest = $dest->child( join '_', $^T, $$, ++$i ) if $dest->is_dir;
Branch: 1 branch
BranchTrueFalseTotal
if $dest->is_dir 0 0 0
21 0 $dest->spew( $message->body );
22 0 $self->debug( 'dumped message to' => $dest );
23 }
24  
25 1 1;
26  
27 __END__
« Mail/Qmail/Filter/Util.pm ↑ Summary Mail/Qmail/Filter/LogEnvelope.pm »