Conformance/Check/DistIni.pm

filter: Statementstmt 40.4% 17 / 42 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 60.0% 6 / 10 Podpod 100% 4 / 4 totaltotal 36.0% 27 / 75 CC 10 SCAR 37.8
CC
10
Cov
30%
adopt
90.0
expected
6.0
config_schema
2.0
CRAP 43.8
« Conformance/Check/CriticProfile.pm ↑ Summary Conformance/Schema.pm »
1 package Dist::Conformance::Check::DistIni 0.011;
2  
3 # ABSTRACT: dist.ini is its template, with the overrides of the repository, authordeps included
4  
5 1 ▶use 5.040;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use re '/aasx';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶no autovivification;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Mojo::Base 'Dist::Conformance::Check::IniTemplate', -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Dist::Conformance::Check::AuthorDeps();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 0 ▶sub config_schema ($class) {
Subroutine config_schema: not called CC=1 SCAR=6.9
Pod documented
15 0 my $schema = $class->SUPER::config_schema;
16 0 $schema->{properties}{authordeps} = Dist::Conformance::Check::AuthorDeps->config_schema->{properties}{overrides};
17 0 return $schema;
18 }
19  
20 0 ▶sub expected ( $self, $snapshot = undef ) {
Subroutine expected: not called CC=2 SCAR=17.9
Pod documented
21 0 my $text = $self->SUPER::expected($snapshot);
22 0 return Dist::Conformance::Check::AuthorDeps::with_overrides( $text, $self->config->{authordeps}, $snapshot );
23 }
24  
25 0 ▶sub compare ( $self, $text, $want ) {
Subroutine compare: not called CC=1 SCAR=6.9
Pod documented
26 0 return ( $self->SUPER::compare( $text, $want ), Dist::Conformance::Check::AuthorDeps::authordep_differences( $text, $want ) );
27 }
28  
29 0 ▶sub adopt ( $self, $snapshot ) {
Subroutine adopt: not called CC=9 SCAR=45.0
Pod documented
30 0 my ( $file, $template ) = @{ $self->config }{qw{file template}};
31 0 ▶ my $text = $snapshot->content($file) // return;
Condition0%0/2
$snapshot->content($file) // (return)
l!l
00
MC/DC0%0/1
$snapshot->content($file) // (return)
$snapshot->content($file)
Truth table0%0/2
A
A= $snapshot->content($file)
Aresult
11
00
32 0 ▶ my %adopted = %{ $self->SUPER::adopt($snapshot) // {} };
Condition0%0/2
$self->SUPER::adopt($snapshot) // {}
l!l
00
MC/DC0%0/1
$self->SUPER::adopt($snapshot) // {}
$self->SUPER::adopt($snapshot)
Truth table0%0/2
A
A= $self->SUPER::adopt($snapshot)
Aresult
11
00
33  
34 0 my ($filled) = $self->template($template);
35 0 my %want = map { $_->{module} => $_->{version} } grep { local ($_) = $_; !Dist::Conformance::Check::AuthorDeps::own_module( $snapshot, $_->{module} ) } Dist::Conformance::Check::AuthorDeps::authordeps_of($filled);
36 0 my %authordeps;
37 0 for my $dep ( Dist::Conformance::Check::AuthorDeps::authordeps_of($text) ) {
38 0 my ( $module, $version ) = @{$dep}{qw{module version}};
39 0 ▶ next if Dist::Conformance::Check::AuthorDeps::own_module( $snapshot, $module );
Branch: 1 branch
BranchTrueFalseTotal
if Dist::Conformance::Check::AuthorDeps::own_module($snapshot, $module) 0 0 0
40 0 ▶ $authordeps{$module} = $version if !exists $want{$module} || $want{$module} ne $version;
Branch: 1 branch
BranchTrueFalseTotal
if not exists $want{$module} or $want{$module} ne $version 0 0 0
Condition0%0/3
not exists $want{$module} or $want{$module} ne $version
l!l&&r!l&&!r
000
MC/DC0%0/2
not exists $want{$module} or $want{$module} ne $version
not exists $want{$module} $want{$module} ne $version
Truth table0%0/3
not(A) or B
A= not exists $want{$module}B= $want{$module} ne $version
ABresult
1X1
011
000
41 }
42 0 ▶ $adopted{authordeps} = \%authordeps if %authordeps;
Branch: 1 branch
BranchTrueFalseTotal
if %authordeps 0 0 0
43 0 ▶ return %adopted ? \%adopted : undef;
Branch: 1 branch
BranchTrueFalseTotal
%adopted ? : 0 0 0
44 }
45  
46 __END__
« Conformance/Check/CriticProfile.pm ↑ Summary Conformance/Schema.pm »