| 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)
MC/DC0%0/1
$snapshot->content($file) // (return)
$snapshot->content($file)
Truth table0%0/2
A
A= $snapshot->content($file)
| |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | my %adopted = %{ $self->SUPER::adopt($snapshot) // {} }; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->SUPER::adopt($snapshot) // {}
MC/DC0%0/1
$self->SUPER::adopt($snapshot) // {}
$self->SUPER::adopt($snapshot)
Truth table0%0/2
A
A= $self->SUPER::adopt($snapshot)
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 40 | 0 | ▶ | $authordeps{$module} = $version if !exists $want{$module} || $want{$module} ne $version; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not exists $want{$module} or $want{$module} ne $version
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
| |||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | $adopted{authordeps} = \%authordeps if %authordeps; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | return %adopted ? \%adopted : undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | __END__ | ||||||||||||||||||||||||||||