blib/lib/Linux/Event/Error.pm

filter: Statementstmt 88.8% 32 / 36 Branchbran 83.3% 5 / 6 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 20 / 24 Podpod 95.0% 19 / 20 totaltotal 84.7% 78 / 92 CC 6 SCAR 5.9
CC
6
Cov
85%
new
4.4
as_string
3.0
port
2.0
CRAP 1.8
« bench/run-first-class-callback-construction-bench.pl ↑ Summary bench/run-datagram-microbench.pl »
1 package Linux::Event::Error;
2 144 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 144 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 144 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 144 our $VERSION = '0.120';
7  
8 144 ▶use overload '""' => 'as_string', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 72 ▶sub new ($class, %arg) {
Subroutine new: called CC=4 SCAR=14.8
Pod undocumented
11 return bless {
12 type => $arg{type} // 'event',
13 operation => $arg{operation},
14 option => $arg{option},
15 errno => $arg{errno},
16 message => $arg{message} // 'Linux::Event error',
17 pending_bytes => $arg{pending_bytes},
18 pending_datagrams => $arg{pending_datagrams},
19 datagram_size => $arg{datagram_size},
20 limit => $arg{limit},
21 fatal => $arg{fatal} ? 1 : 0,
22 host => $arg{host},
23 port => $arg{port},
24 path => $arg{path},
25 family => $arg{family},
26 attempts => $arg{attempts},
27 resolver_message => $arg{resolver_message},
28 timeout => $arg{timeout},
29 deadline => $arg{deadline},
30 72 ▶ }, $class;
Branch: 1 branch
BranchTrueFalseTotal
$arg{'fatal'} ? : 2 70 72
Condition50%2/4
$arg{"type"} // "event"
l!l
720
$arg{"message"} // "Linux::Event error"
l!l
720
MC/DC0%0/1
$arg{"type"} // "event"
$arg{"type"}
MC/DC0%0/1
$arg{"message"} // "Linux::Event error"
$arg{"message"}
Truth table50%1/2
A
A= $arg{"type"}
Aresult
11
00
Truth table50%1/2
A
A= $arg{"message"}
Aresult
11
00
31 }
32  
33 36 ▶sub type ($self) { $self->{type} }
Subroutine type: called CC=1 SCAR=0.0
Pod documented
34 32 ▶sub operation ($self) { $self->{operation} }
Subroutine operation: called CC=1 SCAR=0.0
Pod documented
35 6 ▶sub option ($self) { $self->{option} }
Subroutine option: called CC=1 SCAR=0.0
Pod documented
36 1 ▶sub errno ($self) { $self->{errno} }
Subroutine errno: called CC=1 SCAR=0.0
Pod documented
37 8 ▶sub message ($self) { $self->{message} }
Subroutine message: called CC=1 SCAR=0.0
Pod documented
38 2 ▶sub pending_bytes ($self) { $self->{pending_bytes} }
Subroutine pending_bytes: called CC=1 SCAR=0.0
Pod documented
39 1 ▶sub pending_datagrams ($self) { $self->{pending_datagrams} }
Subroutine pending_datagrams: called CC=1 SCAR=0.0
Pod documented
40 1 ▶sub datagram_size ($self) { $self->{datagram_size} }
Subroutine datagram_size: called CC=1 SCAR=0.0
Pod documented
41 4 ▶sub limit ($self) { $self->{limit} }
Subroutine limit: called CC=1 SCAR=0.0
Pod documented
42 2 ▶sub fatal ($self) { $self->{fatal} }
Subroutine fatal: called CC=1 SCAR=0.0
Pod documented
43 1 ▶sub host ($self) { $self->{host} }
Subroutine host: called CC=1 SCAR=0.0
Pod documented
44 0 ▶sub port ($self) { $self->{port} }
Subroutine port: not called CC=1 SCAR=6.9
Pod documented
45 0 ▶sub path ($self) { $self->{path} }
Subroutine path: not called CC=1 SCAR=6.9
Pod documented
46 0 ▶sub family ($self) { $self->{family} }
Subroutine family: not called CC=1 SCAR=6.9
Pod documented
47 1 ▶sub attempts ($self) { $self->{attempts} }
Subroutine attempts: called CC=1 SCAR=0.0
Pod documented
48 0 ▶sub resolver_message ($self) { $self->{resolver_message} }
Subroutine resolver_message: not called CC=1 SCAR=6.9
Pod documented
49 1 ▶sub timeout ($self) { $self->{timeout} }
Subroutine timeout: called CC=1 SCAR=0.0
Pod documented
50 1 ▶sub deadline ($self) { $self->{deadline} }
Subroutine deadline: called CC=1 SCAR=0.0
Pod documented
51  
52 29 ▶sub as_string ($self, @ignored) {
Subroutine as_string: called CC=3 SCAR=11.0
Pod documented
53 29 my $text = $self->{message};
54 29 ▶ $text = "$self->{operation}: $text" if defined $self->{operation};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"operation"} 29 0 29
55 29 ▶ $text .= " (errno=$self->{errno})" if defined $self->{errno};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"errno"} 7 22 29
56 29 return $text;
57 }
58  
59 144 1;
60  
61 __END__
« bench/run-first-class-callback-construction-bench.pl ↑ Summary bench/run-datagram-microbench.pl »