lib/File/Information/VerifyResult.pm

filter: Statementstmt 51.3% 19 / 37 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 85.7% 6 / 7 Podpod n/a totaltotal 36.2% 25 / 69 CC 10 SCAR 42.4
CC
10
Cov
34%
_new
110.0
BEGIN
1.0
BEGIN
1.0
CRAP 69.1
« lib/File/Information/Filesystem.pm ↑ Summary lib/File/Information/Remote.pm »
1 # Copyright (c) 2024-2026 Philipp Schafft <lion@cpan.org>
2  
3 # licensed under Artistic License 2.0 (see LICENSE file)
4  
5 # ABSTRACT: generic module for extracting information from filesystems
6  
7  
8 package File::Information::VerifyResult;
9  
10 1 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use parent 'File::Information::VerifyBase';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use File::Information::VerifyTestResult;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 our $VERSION = v0.17;
21  
22 # ----------------
23  
24 0 ▶sub _new {
Subroutine _new: not called CC=10 SCAR=47.0
25 0 my ($pkg, %opts) = @_;
26 0 my $self = $pkg->SUPER::_new(%opts);
27 0 my %tests;
28 my $failed;
29 0 my %passed_by_class;
30  
31 0 $self->{tests} = \%tests;
32  
33 0 foreach my $name (File::Information::VerifyTestResult->_supported_tests) {
34 0 my $res = File::Information::VerifyTestResult->_new(test => $name, %opts{'instance', 'base', 'base_from', 'base_to', 'extractor', 'db', 'lifecycle_from', 'lifecycle_to'});
35 0 ▶ my $class = $res->can('_class') ? $res->_class : $res->isa(__PACKAGE__) ? File::Information::VerifyTestResult->CLASS_STRONG : File::Information::VerifyTestResult->CLASS_WEAK;
Branch: 2 branches
BranchTrueFalseTotal
$res->can('_class') ? : 0 0 0
$res->isa(__PACKAGE__) ? : 0 0 0
36 0 $tests{$name} = $res;
37  
38 0 ▶ $failed ||= $res->has_failed;
Condition0%0/3
$failed ||= $res->has_failed
l!l&&r!l&&!r
000
MC/DC0%0/2
$failed ||= $res->has_failed
$failed $res->has_failed
Truth table0%0/3
A ||= B
A= $failedB= $res->has_failed
ABresult
1X1
011
000
39 0 ▶ $passed_by_class{$class} ||= $res->has_passed;
Condition0%0/3
$passed_by_class{$class} ||= $res->has_passed
l!l&&r!l&&!r
000
MC/DC0%0/2
$passed_by_class{$class} ||= $res->has_passed
$passed_by_class{$class} $res->has_passed
Truth table0%0/3
A ||= B
A= $passed_by_class{$class}B= $res->has_passed
ABresult
1X1
011
000
40 }
41  
42 0 ▶ if ($failed) {
Branch: 3 branches
BranchTrueFalseTotal
if ($failed) { } 0 0 0
elsif ($passed_by_class{'File::Information::VerifyTestResult'->CLASS_METADATA} and $passed_by_class{'File::Information::VerifyTestResult'->CLASS_STRONG}) { } 0 0 0
elsif (scalar grep({$_;} values %passed_by_class)) { } 0 0 0
43 0 $self->{status} = $pkg->STATUS_FAILED;
44 ▶ } elsif ($passed_by_class{File::Information::VerifyTestResult->CLASS_METADATA} && $passed_by_class{File::Information::VerifyTestResult->CLASS_STRONG}) {
Condition0%0/3
$passed_by_class{"File::Information::VerifyTestResult"->CLASS_METADATA} and $passed_by_class{"File::Information::VerifyTestResult"->CLASS_STRONG}
!ll&&!rl&&r
000
MC/DC0%0/2
$passed_by_class{"File::Information::VerifyTestResult"->CLASS_METADATA} and $passed_by_class{"File::Information::VerifyTestResult"->CLASS_STRONG}
$passed_by_class{"File::Information::VerifyTestResult"->CLASS_METADATA} $passed_by_class{"File::Information::VerifyTestResult"->CLASS_STRONG}
Truth table0%0/3
A and B
A= $passed_by_class{"File::Information::VerifyTestResult"->CLASS_METADATA}B= $passed_by_class{"File::Information::VerifyTestResult"->CLASS_STRONG}
ABresult
0X0
100
111
45 0 $self->{status} = $pkg->STATUS_PASSED;
46 0 } elsif (scalar grep {$_} values %passed_by_class) {
47 0 $self->{status} = $pkg->STATUS_INSUFFICIENT_DATA;
48 } else {
49 0 $self->{status} = $pkg->STATUS_NO_DATA;
50 }
51  
52 0 return $self;
53 }
54  
55 1 1;
56  
57 __END__
« lib/File/Information/Filesystem.pm ↑ Summary lib/File/Information/Remote.pm »