Tools/ThreadFilter.pm

filter: Statementstmt 41.6% 5 / 12 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 1 / 2 Podpod 0.0% 0 / 1 totaltotal 26.0% 6 / 23 CC 6 SCAR 35.9
CC
6
Cov
28%
filter
42.0
BEGIN
1.0
CRAP 36.1
« Tools/CLI/Edit.pm ↑ Summary Tools/CLI/Create.pm »
1 #!/usr/bin/perl
2  
3 package Mail::Summary::Tools::ThreadFilter;
4 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 has filters => (
7 isa => "ArrayRef",
8 is => "rw",
9 required => 1,
10 auto_deref => 1,
11 );
12  
13 0 ▶sub filter {
Subroutine filter: not called CC=6 SCAR=37.4
Pod undocumented
14 0 my ( $self, %params ) = @_;
15  
16 0 ▶ my $threads = $params{threads} || die "no threads";;
Condition0%0/2
$params{'threads'} || die('no threads')
l!l
00
MC/DC0%0/1
$params{'threads'} || die('no threads')
$params{'threads'}
Truth table0%0/2
A
A= $params{'threads'}
Aresult
11
00
17 0 ▶ my $cb = $params{callback} || die "no callback";
Condition0%0/2
$params{'callback'} || die('no callback')
l!l
00
MC/DC0%0/1
$params{'callback'} || die('no callback')
$params{'callback'}
Truth table0%0/2
A
A= $params{'callback'}
Aresult
11
00
18
19 0 thread: foreach my $thread ( $threads->sortedAll ) {
20 0 foreach my $filter ( $self->filters ) {
21 0 ▶ next thread unless $filter->( $thread );
Branch: 1 branch
BranchTrueFalseTotal
unless &$filter($thread) 0 0 0
22 }
23  
24 0 $cb->($thread);
25 }
26 }
27  
28 1 __PACKAGE__;
29  
30 __END__
« Tools/CLI/Edit.pm ↑ Summary Tools/CLI/Create.pm »