Conformance/Check/ToolConfiguration.pm

filter: Statementstmt 60.7% 17 / 28 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 100% 3 / 3 totaltotal 59.0% 26 / 44 CC 4 SCAR 15.4
CC
4
Cov
53%
update
12.0
check
6.0
config_schema
2.0
CRAP 4.7
« Conformance/Source.pm ↑ Summary Conformance/Source/Directory.pm »
1 package Dist::Conformance::Check::ToolConfiguration 0.008;
2  
3 # ABSTRACT: The configuration files of the tools exist
4  
5 2 ▶use 5.040;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use re '/aasx';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶no autovivification;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Mojo::Base 'Dist::Conformance::Check', -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use Dist::Conformance::Schema();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 0 ▶sub config_schema ($) {
Subroutine config_schema: not called CC=1 SCAR=6.9
Pod documented
15 return {
16 0 required => ['files'],
17 properties => { files => { type => 'object', additionalProperties => { %$Dist::Conformance::Schema::PATH, nullable => 1 } } },
18 };
19 }
20  
21  
22 0 ▶sub check ( $self, $snapshot ) {
Subroutine check: not called CC=2 SCAR=17.9
Pod documented
23 0 my @missing = $self->missing( $snapshot, sort keys %{ $self->config->{files} } );
24 0 ▶ return ( 'fail', 'missing: ' . join ', ', @missing ) if @missing;
Branch: 1 branch
BranchTrueFalseTotal
if @missing 0 0 0
25 0 return ( 'pass', 'all present' );
26 }
27  
28  
29 0 ▶sub update ( $self, $update ) {
Subroutine update: not called CC=3 SCAR=24.8
Pod documented
30 0 my $files = $self->config->{files};
31 0 for my $path ( $self->missing( $update->snapshot, sort keys %$files ) ) {
32 0 ▶ if ( defined $files->{$path} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $$files{$path}) { } 0 0 0
33 0 $self->write_template( $update, $path, $files->{$path} );
34 }
35 else {
36 0 $update->by_hand("Write $path by hand: the flavor names no template for it");
37 }
38 }
39 0 return;
40 }
41  
42 __END__
« Conformance/Source.pm ↑ Summary Conformance/Source/Directory.pm »