| 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
Condition83%5/6
$report and $type and ref($report) =~ /::\Q$type\E$/u
$report and $type
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
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 105 | ▶ | $type ||= "Base"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$type ||= "Base"
MC/DC100%1/1
$type ||= "Base"
$type
Truth table100%2/2
A
A= $type
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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; | |||||||||||||||||||||||||||||||||||||||||