blib/lib/PDL/NiceSlice/FilterUtilCall.pm

filter: Statementstmt 48.7% 20 / 41 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 1 totaltotal 37.6% 26 / 69 CC 9 SCAR 39.4
CC
9
Cov
34%
__ANON__
90.0
unimport
2.0
make_filter
1.8
CRAP 51.2
« blib/lib/PDL/Dbg.pm ↑ Summary blib/lib/PDL/DiskCache.pm »
1 # This original Filter::Util::Call-based
2 # PDL::NiceSlice engine.
3 #
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Filter::Util::Call;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 {
9 1 ▶no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶sub PDL::NiceSlice::FilterUtilCall::make_filter {
Subroutine make_filter: called CC=1 SCAR=5.8
Pod undocumented
11 1 my ($class,$file,$offset) = @_;
12 1 my $terminator = terminator_regexp($class);
13 0 ▶ sub {
Subroutine __ANON__: not called CC=9 SCAR=45.0
14 0 my ($status, $off, $end);
15 0 my $count = 0;
16 0 my $data = "";
17 0 ▶ while ($status = filter_read()) {
Branch: 1 branch
BranchTrueFalseTotal
if ($status = &filter_read()) 0 0 0
18 0 ▶ return $status if $status < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $status < 0 0 0 0
19 0 ▶ if (defined($terminator) && m/$terminator/) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $terminator and /$terminator/) 0 0 0
Condition0%0/3
defined $terminator and /$terminator/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $terminator and /$terminator/
defined $terminator /$terminator/
Truth table0%0/3
A and B
A= defined $terminatorB= /$terminator/
ABresult
0X0
100
111
20 0 $off=1;
21 0 last;
22 }
23 0 ▶ if (m/^\s*(__END__|__DATA__)\s*$/) {
Branch: 1 branch
BranchTrueFalseTotal
if (/^\s*(__END__|__DATA__)\s*$/) 0 0 0
24 0 $end=$1; $off = 1;
25 0 last;
26 }
27 0 $data .= $_;
28 0 $count++;
29 0 $_ = "";
30 }
31 0 $_ = $data;
32 0 ▶ $_ = findslice $_ unless $status < 0; # the actual filter
Branch: 1 branch
BranchTrueFalseTotal
unless $status < 0 0 0 0
33 0 ▶ $_ .= "no $class;\n" if $off;
Branch: 1 branch
BranchTrueFalseTotal
if $off 0 0 0
34 0 ▶ $_ .= "$end\n" if $end;
Branch: 1 branch
BranchTrueFalseTotal
if $end 0 0 0
35 0 return $count;
36 1 };
37 }
38 }
39  
40 1 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
41 1 my ($class) = @_;
42 1 my ($file,$offset) = (caller)[1,2]; # for error reporting
43 ## Parse class name into a regexp suitable for filtration
44 1 filter_add(PDL::NiceSlice::FilterUtilCall::make_filter($class, $file, $offset+1));
45 }
46  
47 0 ▶sub unimport {
Subroutine unimport: not called CC=1 SCAR=6.9
48 0 filter_del();
49 }
50  
51 1 1;
« blib/lib/PDL/Dbg.pm ↑ Summary blib/lib/PDL/DiskCache.pm »