Airbrake/Error.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 6 / 6 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 94.7% 36 / 38 CC 5 SCAR 9.4
CC
5
Cov
100%
BUILDARGS
4.0
to_hash
2.0
BEGIN
1.0
CRAP 2.6
« Airbrake.pm ↑ Summary
1 package Net::Airbrake::Error;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Class::Tiny qw(type message backtrace);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 8 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=4 SCAR=13.9
Pod undocumented
9 8 my $class = shift;
10 8 my ($param) = @_;
11  
12 8 ▶ if (ref $param eq 'HASH') {
Branch: 3 branches
BranchTrueFalseTotal
if (ref $param eq 'HASH') { } 2 6 8
elsif (ref $param) { } 1 5 6
elsif ($param =~ /^(.+) at (.+) line (\d+)\.$/) { } 3 2 5
13 2 return $param;
14 }
15 elsif (ref $param) {
16 1 require Data::Dumper;
17 1 return { type => ref $param, message => Data::Dumper::Dumper($param) };
18 }
19 elsif ($param =~ /^(.+) at (.+) line (\d+)\.$/) {
20 return {
21 3 type => 'CORE::die',
22 message => $1,
23 backtrace => [ { file => $2, line => $3, function => 'N/A' } ],
24 };
25 }
26 else {
27 2 return { type => 'error', message => "$param" };
28 }
29 }
30  
31 2 ▶sub to_hash {
Subroutine to_hash: called CC=2 SCAR=6.9
Pod undocumented
32 2 my $self = shift;
33  
34 {
35 type => $self->type,
36 message => $self->message,
37 backtrace => [
38 map {
39 +{
40 file => '' . $_->{file},
41 line => 0 + $_->{line},
42 function => '' . $_->{function},
43 }
44 2 ▶ } @{$self->backtrace || []}
Condition100%2/2
$self->backtrace || []
l!l
11
MC/DC100%1/1
$self->backtrace || []
$self->backtrace
Truth table100%2/2
A
A= $self->backtrace
Aresult
11
00
45 ],
46 };
47 }
48  
49 4 1;
50 __END__
« Airbrake.pm ↑ Summary