TOON/Error.pm

filter: Statementstmt 75.0% 12 / 16 Branchbran n/a Conditioncond 50.0% 4 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 55.5% 5 / 9 Podpod 100% 6 / 6 totaltotal 62.7% 27 / 43 CC 5 SCAR 13.1
CC
5
Cov
67%
new
7.2
message
2.0
line
2.0
CRAP 3.7
« TOON/PP.pm ↑ Summary TOON.pm »
1 package TOON::Error;
2  
3 5 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use feature 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use overload '""' => 'as_string', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 our $VERSION = '0.0.1';
8  
9 ▶sub new ($class, %args) {
Subroutine new: called CC=5 SCAR=19.7
Pod documented
10 return bless {
11 message => $args{message} // 'Unknown TOON error',
12 line => $args{line} // 1,
13 column => $args{column} // 1,
14 1 ▶ offset => $args{offset} // 0,
Condition50%4/8
$args{"message"} // "Unknown TOON error"
l!l
10
$args{"line"} // 1
l!l
10
$args{"column"} // 1
l!l
10
$args{"offset"} // 0
l!l
10
MC/DC0%0/1
$args{"message"} // "Unknown TOON error"
$args{"message"}
MC/DC0%0/1
$args{"line"} // 1
$args{"line"}
MC/DC0%0/1
$args{"column"} // 1
$args{"column"}
MC/DC0%0/1
$args{"offset"} // 0
$args{"offset"}
Truth table50%1/2
A
A= $args{"message"}
Aresult
11
00
Truth table50%1/2
A
A= $args{"line"}
Aresult
11
00
Truth table50%1/2
A
A= $args{"column"}
Aresult
11
00
Truth table50%1/2
A
A= $args{"offset"}
Aresult
11
00
15 }, $class;
16 }
17  
18 0 ▶sub message ($self) { return $self->{message} }
Subroutine message: not called CC=1 SCAR=6.9
Pod documented
19 0 ▶sub line ($self) { return $self->{line} }
Subroutine line: not called CC=1 SCAR=6.9
Pod documented
20 0 ▶sub column ($self) { return $self->{column} }
Subroutine column: not called CC=1 SCAR=6.9
Pod documented
21 0 ▶sub offset ($self) { return $self->{offset} }
Subroutine offset: not called CC=1 SCAR=6.9
Pod documented
22  
23 ▶sub as_string ($self, @) {
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
24 return sprintf '%s at line %d, column %d',
25 1 $self->{message}, $self->{line}, $self->{column};
26 }
27  
28 5 1;
29  
30 __END__
« TOON/PP.pm ↑ Summary TOON.pm »