blib/lib/Linux/Event/Kernel/Inotify/Event.pm

filter: Statementstmt 95.8% 23 / 24 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 91.6% 11 / 12 Podpod 100% 6 / 6 totaltotal 91.8% 45 / 49 CC 3 SCAR 4.1
CC
3
Cov
93%
_new
3.0
mask
2.0
BEGIN
1.0
CRAP 1.5
« bench/run-wakeup-microbench.pl ↑ Summary bench/run-tls-accept-setup-bench.pl »
1 package Linux::Event::Kernel::Inotify::Event;
2 9 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 our $VERSION = '0.119';
7  
8 9 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 9 ▶use constant IN_ISDIR => 0x40000000;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 325 ▶sub _new ($class, $watch, $name, $mask, $cookie) {
Subroutine _new: called CC=3 SCAR=11.1
13 325 ▶ my $path = defined($name) && length($name)
Branch: 1 branch
BranchTrueFalseTotal
defined $name && length $name ? : 11 314 325
Condition66%2/3
defined $name and length $name
!ll&&!rl&&r
314011
MC/DC50%1/2
defined $name and length $name
defined $name length $name
Truth table66%2/3
A and B
A= defined $nameB= length $name
ABresult
0X0
100
111
14 ? File::Spec->catfile($watch->path, $name)
15 : $watch->path;
16 325 return bless {
17 watch => $watch,
18 name => $name,
19 path => $path,
20 mask => $mask,
21 cookie => $cookie,
22 }, $class;
23 }
24  
25 2 ▶sub watch ($self) { $self->{watch} }
Subroutine watch: called CC=1 SCAR=0.0
Pod documented
26 13 ▶sub name ($self) { $self->{name} }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
27 5 ▶sub path ($self) { $self->{path} }
Subroutine path: called CC=1 SCAR=0.0
Pod documented
28 0 ▶sub mask ($self) { $self->{mask} }
Subroutine mask: not called CC=1 SCAR=6.9
Pod documented
29 3 ▶sub cookie ($self) { $self->{cookie} }
Subroutine cookie: called CC=1 SCAR=0.0
Pod documented
30 2 ▶sub is_directory ($self) { !!($self->{mask} & IN_ISDIR) }
Subroutine is_directory: called CC=1 SCAR=0.0
Pod documented
31  
32 9 1;
33  
34 __END__
« bench/run-wakeup-microbench.pl ↑ Summary bench/run-tls-accept-setup-bench.pl »