blib/lib/Aion/Carp.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 6 / 6 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 100% 1 / 1 totaltotal 100% 51 / 51 CC 5 SCAR 9.8
CC
5
Cov
100%
handler
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
↑ Summary
1 package Aion::Carp;
2 1 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use common::sense;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = "1.6";
6  
7 1 ▶use Carp qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Scalar::Util qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 7 ▶sub handler {
Subroutine handler: called CC=5 SCAR=16.1
Pod documented
11 7 my ($x) = @_;
12  
13 7 ▶ if(!ref $x) {
Branch: 2 branches
BranchTrueFalseTotal
if (not ref $x) { } 4 3 7
elsif (builtin::reftype($x) eq 'HASH' and not exists $x->{'STACKTRACE'}) { } 1 3 4
14 1 ▶ no utf8; use bytes;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶ if($x =~ s/\n[ \t]+\.\.\.propagated at .* line \d+\.\n\z/\n/) {}
Branch: 1 branch
BranchTrueFalseTotal
if ($x =~ s/\n[ \t]+\.\.\.propagated at .* line \d+\.\n\z/\n/d) { } 1 3 4
16 else {
17 3 $x =~ s/ at .*? line \d+\.\n\z//;
18 3 my $c = Carp::longmess('');
19 3 $c =~ s/^( at .*? line \d+)\.\n/$x\n\tdie(...) called$1\n/;
20 3 $x = $c;
21 }
22 }
23 ▶ elsif(Scalar::Util::reftype($x) eq "HASH" && !exists $x->{STACKTRACE}) {
Condition100%3/3
builtin::reftype($x) eq "HASH" and not exists $x->{"STACKTRACE"}
!ll&&!rl&&r
111
MC/DC100%2/2
builtin::reftype($x) eq "HASH" and not exists $x->{"STACKTRACE"}
builtin::reftype($x) eq "HASH" not exists $x->{"STACKTRACE"}
Truth table100%3/3
A and not(B)
A= builtin::reftype($x) eq "HASH"B= not exists $x->{"STACKTRACE"}
ABresult
0X0
100
111
24 1 my $c = Carp::longmess("die(...) called");
25 1 $c =~ s/^(.*\d+)\.\n/$1\n/;
26 1 $x->{STACKTRACE} = $c;
27 }
28  
29 7 die $x;
30 }
31  
32 2 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
33 2 $SIG{__DIE__} = \&handler;
34 }
35  
36 1 1;
37  
38 __END__
↑ Summary