Enbld/Exception.pm

filter: Statementstmt 100% 25 / 25 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 92.1% 35 / 38 SCAR 11.0
CC
3
Cov
97%
new
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Enbld/Target/Attribute/TestAction.pm ↑ Summary Enbld/Target/AttributeCollector.pm »
1 package Enbld::Exception;
2  
3 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 25 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 25 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 use overload (
10 25 q{""} => \&to_string,
11 fallback => 1,
12 25 ▶ );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 sub new {
15 79 ▶ my ( $class, $message, $param ) = @_;
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
16  
17 79 chomp( $message );
18  
19 79 ▶ if ( $param ) { $message .= "\n" . Dumper( $param ) };
Branch: 1 branch
BranchTrueFalseTotal
if ($param) 40 39 79
20  
21 79 ▶ my $location = $ENV{HARNESS_ACTIVE} ? Carp::longmess() : Carp::shortmess();
Branch: 1 branch
BranchTrueFalseTotal
$ENV{'HARNESS_ACTIVE'} ? : 79 0 79
22  
23 79 my $self = {
24 message => $message,
25 caller_location => $location,
26 };
27  
28 79 return bless $self, $class;
29 }
30  
31 sub to_string {
32 79 ▶ my $self = shift;
Subroutine to_string: called CC=1 SCAR=0.0
Pod undocumented
33  
34 79 return "ABORT:$self->{message}$self->{caller_location}";
35 }
36  
37 25 1;
« Enbld/Target/Attribute/TestAction.pm ↑ Summary Enbld/Target/AttributeCollector.pm »