Conformance/Source.pm

filter: Statementstmt 60.0% 15 / 25 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 5 / 10 Podpod 100% 5 / 5 totaltotal 46.3% 25 / 54 CC 5 SCAR 16.0
CC
5
Cov
43%
file
12.0
base
6.0
exists_file
6.0
CRAP 4.9
« Conformance/Check/ToolConfiguration.pm ↑ Summary Conformance/Source/Directory.pm »
1 package Dist::Conformance::Source 0.005;
2  
3 # ABSTRACT: Where the standards come from: the flavor files and the templates
4  
5 4 ▶use 5.040;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use re '/aasx';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use Mojo::Base -base, -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use Dist::Conformance::Schema();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 4 has path => q{};
14  
15  
16 0 ▶sub root ($self) { die( ref($self) . " does not implement root\n" ) }
Subroutine root: not called CC=1 SCAR=6.9
Pod documented
17  
18  
19 0 ▶sub describe ($self) { die( ref($self) . " does not implement describe\n" ) }
Subroutine describe: not called CC=1 SCAR=6.9
Pod documented
20  
21  
22 0 ▶sub base ($self) {
Subroutine base: not called CC=2 SCAR=17.9
Pod documented
23 0 my $root = $self->root;
24 0 ▶ return $self->path ne q{} ? $root->child( split m{/}, $self->path ) : $root;
Branch: 1 branch
BranchTrueFalseTotal
$self->path ne '' ? : 0 0 0
25 }
26  
27  
28 0 ▶sub file ( $self, $relative ) {
Subroutine file: not called CC=3 SCAR=24.8
Pod documented
29 0 Dist::Conformance::Schema::relative_path( $relative, 'the standards' );
30 0 my $file = $self->base->child( split m{/}, $relative );
31 0 ▶ die( "The standards at " . $self->describe . " have no $relative\n" ) if !-e $file || -d _;
Branch: 1 branch
BranchTrueFalseTotal
if not -e $file or -d _ 0 0 0
Condition0%0/3
not -e $file or -d _
l!l&&r!l&&!r
000
MC/DC0%0/2
not -e $file or -d _
not -e $file -d _
Truth table0%0/3
not(A) or B
A= not -e $fileB= -d _
ABresult
1X1
011
000
32 0 return $file->slurp;
33 }
34  
35  
36 0 ▶sub exists_file ( $self, $relative ) {
Subroutine exists_file: not called CC=2 SCAR=17.9
Pod documented
37 0 my $file = $self->base->child( split m{/}, $relative );
38 0 ▶ return -e $file && !-d _;
Condition0%0/3
-e $file && !-d(_)
!ll&&!rl&&r
000
MC/DC0%0/2
-e $file && !-d(_)
-e $file !-d(_)
Truth table0%0/3
A && not(B)
A= -e $fileB= !-d(_)
ABresult
0X0
100
111
39 }
40  
41 __END__
« Conformance/Check/ToolConfiguration.pm ↑ Summary Conformance/Source/Directory.pm »