Enbld/Exception.pm

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