blib/lib/Rex/Report.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 75.0% 3 / 4 Conditioncond 87.5% 7 / 8 MC/DCmcdc 75.0% 3 / 4 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 87.7% 43 / 49 CC 6 SCAR 12.0
CC
6
Cov
92%
create
6.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.3
« blib/lib/Rex/Helper/DBI.pm ↑ Summary lib/Rex/File/Parser/Data.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Report;
6  
7 136 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 136 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 110 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 105 our $VERSION = '1.16.1'; # VERSION
12  
13 105 my $report;
14  
15 106 ▶sub create {
Subroutine create: called CC=6 SCAR=18.0
Pod undocumented
16 106 my ( $class, $type ) = @_;
17 106 ▶ if ( $report && $type && ref($report) =~ m/::\Q$type\E$/ ) { return $report; }
Branch: 1 branch
BranchTrueFalseTotal
if ($report and $type and ref($report) =~ /::\Q$type\E$/u) 1 105 106
Condition83%5/6
$report and $type and ref($report) =~ /::\Q$type\E$/u
!ll&&!rl&&r
10501
$report and $type
!ll&&!rl&&r
70351
MC/DC66%2/3
$report and $type and ref($report) =~ /::\Q$type\E$/u
$report $type ref($report) =~ /::\Q$type\E$/u
Truth table75%3/4
A and B and C
A= $reportB= $typeC= ref($report) =~ /::\Q$type\E$/u
ABCresult
0XX0
10X0
1100
1111
18  
19 105 ▶ $type ||= "Base";
Condition100%2/2
$type ||= "Base"
l!l
1104
MC/DC100%1/1
$type ||= "Base"
$type
Truth table100%2/2
A
A= $type
Aresult
11
00
20  
21 105 my $c = "Rex::Report::$type";
22 105 ▶ eval "use $c";
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 105 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 105 105
25 0 die("No reporting class $type found.");
26 }
27  
28 105 $report = $c->new;
29 105 return $report;
30 }
31  
32 1 ▶sub destroy { $report = undef; }
Subroutine destroy: called CC=1 SCAR=0.0
Pod undocumented
33  
34 105 1;
« blib/lib/Rex/Helper/DBI.pm ↑ Summary lib/Rex/File/Parser/Data.pm »