ANSIColor/AllError.pm

filter: Statementstmt 71.4% 25 / 35 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 77.7% 7 / 9 Podpod 100% 1 / 1 totaltotal 61.1% 33 / 54 CC 4 SCAR 15.2
CC
4
Cov
60%
err
12.0
__ANON__
6.0
BEGIN
1.0
CRAP 4.6
↑ Summary ANSIColor/ErrorList.pm »
1 package Error::Pure::ANSIColor::AllError;
2  
3 2 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Error::Pure::Utils qw(err_helper);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Error::Pure::Output::ANSIColor qw(err_bt_pretty);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use List::Util qw(none);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 # Constants.
13 2 Readonly::Array our @EXPORT_OK => qw(err);
14 2 Readonly::Scalar my $EVAL => 'eval {...}';
15  
16 2 our $VERSION = 0.28;
17  
18 # Process error.
19 sub err {
20 0 ▶ my @msg = @_;
Subroutine err: not called CC=3 SCAR=24.8
Pod documented
21  
22 # Get errors structure.
23 0 my @errors = err_helper(@msg);
24  
25 # Finalize in main on last err.
26 0 my $stack_ar = $errors[-1]->{'stack'};
27 0 ▶ if ($stack_ar->[-1]->{'class'} eq 'main'
Branch: 1 branch
BranchTrueFalseTotal
if ($stack_ar->[-1]{'class'} eq 'main' and &none(sub { $_ eq $EVAL or $_ =~ /^eval '/ms; } , map({$_->{'sub'};} @{$stack_ar;}))) { } 0 0 0
Condition0%0/3
$stack_ar->[-1]{"class"} eq "main" and &none(sub { $_ eq $EVAL or $_ =~ /^eval '/ms; } , map({$_->{"sub"};} @{$stack_ar;}))
!ll&&!rl&&r
000
MC/DC0%0/2
$stack_ar->[-1]{"class"} eq "main" and &none(sub { $_ eq $EVAL or $_ =~ /^eval '/ms; } , map({$_->{"sub"};} @{$stack_ar;}))
$stack_ar->[-1]{"class"} eq "main" &none(sub { $_ eq $EVAL or $_ =~ /^eval '/ms; } , map({$_->{"sub"};} @{$stack_ar;}))
Truth table0%0/3
A and B
A= $stack_ar->[-1]{"class"} eq "main"B= &none(sub { $_ eq $EVAL or $_ =~ /^eval '/ms; } , map({$_->{"sub"};} @{$stack_ar;}))
ABresult
0X0
100
111
28 0 ▶ && none { $_ eq $EVAL || $_ =~ m/^eval '/ms }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq $EVAL or $_ =~ /^eval '/ms 0 0 0
29 0 map { $_->{'sub'} } @{$stack_ar}) {
30  
31 0 die scalar err_bt_pretty(@errors);
32  
33 # Die for eval.
34 } else {
35 0 die "$errors[-1]->{'msg'}->[0]\n";
36 }
37  
38 0 return;
39 }
40  
41 2 1;
42  
43 __END__
↑ Summary ANSIColor/ErrorList.pm »