| 1 | package WWW::FBX::Error; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 23 | ▶ | use 5.014001; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 23 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 23 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 23 | ▶ | use Devel::StackTrace; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | #Stringify using error sub | ||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 23 | ▶ | use overload '""' => \&error, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 23 | 'fallback' => 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 23 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 23 | has fbx_error => ( is => 'rw', predicate => 'has_fbx_error' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 15 | 23 | has http_response => ( isa => 'HTTP::Response', is => 'rw', required => 1, handles => [qw/code message/] ); | |||||||||||||||||||||||||||||||||||||||||||||
| 16 | 23 | has stack_trace => ( is => 'ro', init_arg => undef, builder => '_build_stack_trace' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | 23 | has _stringified => ( is => 'rw', init_arg => undef, default => undef ); | |||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub _build_stack_trace { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_stack_trace: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | my $seen; | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | my $this_sub = (caller 0)[3]; | |||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | Devel::StackTrace->new(frame_filter => sub { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | my $caller = shift->{caller}; | |||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | my $in_nt = $caller->[0] =~ /^WWW::Net::/ || $caller->[3] eq $this_sub; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$caller->[0] =~ /^WWW::Net::/u || $caller->[3] eq $this_sub
MC/DC0%0/2
$caller->[0] =~ /^WWW::Net::/u || $caller->[3] eq $this_sub
$caller->[0] =~ /^WWW::Net::/u
$caller->[3] eq $this_sub
Truth table0%0/3
A || B
A= $caller->[0] =~ /^WWW::Net::/uB= $caller->[3] eq $this_sub
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | ($seen ||= $in_nt) && !$in_nt || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$seen ||= $in_nt and not $in_nt
$seen ||= $in_nt
MC/DC0%0/3
$seen ||= $in_nt and not $in_nt
$seen
$in_nt
not $in_nt
Truth table0%0/5
A ||= B and not(C)
A= $seenB= $in_ntC= not $in_nt
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | }); | |||||||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub error { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | return $self->_stringified if $self->_stringified; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | # Don't walk on $@ | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | local $@; | |||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | my $error = $self->has_fbx_error && $self->fbx_error_text | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
$self->has_fbx_error && $self->fbx_error_text || $self->http_response->status_line
$self->has_fbx_error and $self->fbx_error_text
MC/DC0%0/3
$self->has_fbx_error && $self->fbx_error_text || $self->http_response->status_line
$self->has_fbx_error
$self->fbx_error_text
$self->http_response->status_line
Truth table0%0/5
A and B || C
A= $self->has_fbx_errorB= $self->fbx_error_textC= $self->http_response->status_line
| |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | || $self->http_response->status_line; | ||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | my ($location) = $self->stack_trace->frame(0)->as_string =~ /( at .*)/; | |||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | return $self->_stringified($error . ($location || '')); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$location || ''
MC/DC0%0/1
$location || ''
$location
Truth table0%0/2
A
A= $location
| |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub fbx_error_text { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fbx_error_text: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | return '' unless $self->has_fbx_error; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | my $e = $self->fbx_error; | |||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | return try { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | exists $e->{msg} && $e->{msg}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | } || ''; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
&try(sub {
exists $e->{'msg'} and $e->{'msg'};
}
) || ''
MC/DC0%0/1
&try(sub {
exists $e->{'msg'} and $e->{'msg'};
}
) || ''
&try(sub {
exists $e->{'msg'} and $e->{'msg'};
}
)
Truth table0%0/2
A
A= &try(sub {
exists $e->{'msg'} and $e->{'msg'};
}
)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub fbx_error_code { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fbx_error_code: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||
| 60 | return $self->has_fbx_error | ||||||||||||||||||||||||||||||||||||||||||||||
| 61 | && exists $self->fbx_error->{error_code} | ||||||||||||||||||||||||||||||||||||||||||||||
| 62 | && $self->fbx_error->{error_code} | ||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | || 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/8
$self->has_fbx_error && exists $self->fbx_error->{'error_code'} && $self->fbx_error->{'error_code'} || 0
$self->has_fbx_error and exists $self->fbx_error->{"error_code"} and $self->fbx_error->{"error_code"}
$self->has_fbx_error and exists $self->fbx_error->{"error_code"}
MC/DC0%0/3
$self->has_fbx_error && exists $self->fbx_error->{'error_code'} && $self->fbx_error->{'error_code'} || 0
$self->has_fbx_error
exists $self->fbx_error->{"error_code"}
$self->fbx_error->{"error_code"}
Truth table0%0/4
A and B and C
A= $self->has_fbx_errorB= exists $self->fbx_error->{"error_code"}C= $self->fbx_error->{"error_code"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 23 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 23 | ▶ | no Moose; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 23 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 72 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||