| 1 | package App::Midgen::Role::Heuristics; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | our $VERSION = '0.34'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | $VERSION = eval $VERSION; ## no critic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use constant {TRUE => 1, FALSE => 0, ONE => 1, TWO => 2}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Types::Standard qw( Bool ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | requires qw( debug meta2 format ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use Data::Printer {caller_info => 1,}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use Term::ANSIColor qw( :constants colored colorstrip ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | # correct incorrectly cast modules as RuntimeRecommends and re-cast as RuntimeRequires | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | # recast_to_runtimerequires | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub recast_to_runtimerequires { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
recast_to_runtimerequires: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | my $requires_ref = shift || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
shift() || (return)
MC/DC0%0/1
shift() || (return)
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | my $recommends_ref = shift || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
shift() || (return)
MC/DC0%0/1
shift() || (return)
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | #extract module names to check from RuntimeRecommends bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | my @runtime_recommends; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | foreach my $current_recommends (sort keys %{$recommends_ref}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | push @runtime_recommends, $current_recommends; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | foreach my $module (@runtime_recommends) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | #2nd part of mro - MRO::Compat catch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | if ( $module eq 'MRO::Compat' and $self->meta2 == FALSE ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$module eq "MRO::Compat" and $self->meta2 == 0
MC/DC0%0/2
$module eq "MRO::Compat" and $self->meta2 == 0
$module eq "MRO::Compat"
$self->meta2 == 0
Truth table0%0/3
A and B
A= $module eq "MRO::Compat"B= $self->meta2 == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | print "recasting - $module\n" if ($self->verbose == TWO); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | # add to RuntimeRequires bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | $requires_ref->{$module} = $recommends_ref->{$module}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | # delete from RuntimeRecommends bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | delete $recommends_ref->{$module}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | # update modules bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | $self->{modules}{$module}{prereqs} = 'RuntimeRequires'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | # an ode to negitave logic :) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=8 SCAR=42.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | unless ($self->{modules}{$module}{dual_life} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1 or $self->{"modules"}{$module}{"version"} eq "!mcpan" or $self->{"modules"}{$module}{"count"} == 1
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1 or $self->{"modules"}{$module}{"version"} eq "!mcpan"
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1
MC/DC0%0/4
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1 or $self->{"modules"}{$module}{"version"} eq "!mcpan" or $self->{"modules"}{$module}{"count"} == 1
$self->{"modules"}{$module}{"dual_life"}
$self->{"modules"}{$module}{"corelist"} == 1
$self->{"modules"}{$module}{"version"} eq "!mcpan"
$self->{"modules"}{$module}{"count"} == 1
Truth table0%0/5
A or B or C or D
A= $self->{"modules"}{$module}{"dual_life"}B= $self->{"modules"}{$module}{"corelist"} == 1C= $self->{"modules"}{$module}{"version"} eq "!mcpan"D= $self->{"modules"}{$module}{"count"} == 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | or $self->{modules}{$module}{corelist} == 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | or $self->{modules}{$module}{version} eq '!mcpan' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | or $self->{modules}{$module}{count} == 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | if ($self->_rc_requires($module, $self->{modules}{$module}{infiles})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | # add to RuntimeRequires bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | $requires_ref->{$module} = $recommends_ref->{$module}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | # delete from RuntimeRecommends bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | delete $recommends_ref->{$module}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | # update modules bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | $self->{modules}{$module}{prereqs} = 'RuntimeRequires'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | print BRIGHT_BLACK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | . 'Info: re-cast module ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | . $module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | . ' to RuntimeRequires' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | . CLEAR . "\n" if ($self->verbose >= ONE); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | p $self->{modules}{$module} if ($self->verbose == TWO); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | ## this may help for future hacking | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | # [0] "/lib/Module/Install/Admin/Metadata.pm", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | # [1] 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | # [2] "Perl::PrereqScanner", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | # [3] "RuntimeRequires" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | # composed method _rc_requires | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | sub _rc_requires { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rc_requires: not called CC=8 SCAR=42.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | my ($self, $module, $infile) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | foreach my $index (0 .. $#{$infile}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | # next if in a test dir | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | next if $infile->[$index][0] =~ m/\A\/x?t/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | # ignore RuntimeRecommends | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | next if $infile->[$index][3] eq 'RuntimeRecommends'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | # find RuntimeRequires which are not from same file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | if ($infile->[$index][3] eq 'RuntimeRequires' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$infile->[$index][3] eq "RuntimeRequires" and $infile->[$index][0] ne $$infile[$index - 1][0]
MC/DC0%0/2
$infile->[$index][3] eq "RuntimeRequires" and $infile->[$index][0] ne $$infile[$index - 1][0]
$infile->[$index][3] eq "RuntimeRequires"
$infile->[$index][0] ne $$infile[$index - 1][0]
Truth table0%0/3
A and B
A= $infile->[$index][3] eq "RuntimeRequires"B= $infile->[$index][0] ne $$infile[$index - 1][0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | and ($infile->[$index][0] ne $infile->[$index - 1][0])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | p $module if $self->debug; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | p $infile->[$index] if $self->debug; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | # found | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | return TRUE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | return FALSE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | # correct incorrectly cast modules as TestSuggests and re-cast as TestRequires | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | # recast_to_testrequires | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | sub recast_to_testrequires { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
recast_to_testrequires: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | my $requires_ref = shift || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
shift() || (return)
MC/DC0%0/1
shift() || (return)
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | my $suggests_ref = shift || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
shift() || (return)
MC/DC0%0/1
shift() || (return)
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | #extract module names to check from RuntimeRecommends bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | my @test_suggests; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | foreach my $current_suggests (sort keys %{$suggests_ref}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | push @test_suggests, $current_suggests; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | foreach my $module (@test_suggests) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | # an ode to negitave logic :) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=8 SCAR=42.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | unless ($self->{modules}{$module}{dual_life} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1 or $self->{"modules"}{$module}{"version"} eq "!mcpan" or $self->{"modules"}{$module}{"count"} == 1
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1 or $self->{"modules"}{$module}{"version"} eq "!mcpan"
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1
MC/DC0%0/4
$self->{"modules"}{$module}{"dual_life"} or $self->{"modules"}{$module}{"corelist"} == 1 or $self->{"modules"}{$module}{"version"} eq "!mcpan" or $self->{"modules"}{$module}{"count"} == 1
$self->{"modules"}{$module}{"dual_life"}
$self->{"modules"}{$module}{"corelist"} == 1
$self->{"modules"}{$module}{"version"} eq "!mcpan"
$self->{"modules"}{$module}{"count"} == 1
Truth table0%0/5
A or B or C or D
A= $self->{"modules"}{$module}{"dual_life"}B= $self->{"modules"}{$module}{"corelist"} == 1C= $self->{"modules"}{$module}{"version"} eq "!mcpan"D= $self->{"modules"}{$module}{"count"} == 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | or $self->{modules}{$module}{corelist} == 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | or $self->{modules}{$module}{version} eq '!mcpan' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | or $self->{modules}{$module}{count} == 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | if ($self->_rc_tests($module, $self->{modules}{$module}{infiles})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | # add to RuntimeRequires bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $requires_ref->{$module} = $suggests_ref->{$module}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | # delete from RuntimeRecommends bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | delete $suggests_ref->{$module}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | # update modules bucket | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | $self->{modules}{$module}{prereqs} = 'TestRequires'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | print BRIGHT_BLACK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | . 'Info: re-cast module ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | . $module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | . ' to TestRequires' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | . CLEAR . "\n" if ($self->verbose >= ONE); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | p $self->{modules}{$module} if $self->debug; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | ## this may help for future hacking | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | # [0] "/lib/Module/Install/Admin/Metadata.pm", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | # [1] 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | # [2] "Perl::PrereqScanner", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | # [3] "RuntimeRequires" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | # composed method _rc_requires | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | sub _rc_tests { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rc_tests: not called CC=8 SCAR=42.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | my ($self, $module, $infile) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | foreach my $index (0 .. $#{$infile}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | # next if in a test dir | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | next if $infile->[$index][0] !~ m/\At/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | # ignore RuntimeRecommends | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | next if $infile->[$index][3] eq 'TestSuggests'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | # find RuntimeRequires which are not from same file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | if ($infile->[$index][3] eq 'TestRequires' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$infile->[$index][3] eq "TestRequires" and $infile->[$index][0] ne $$infile[$index - 1][0]
MC/DC0%0/2
$infile->[$index][3] eq "TestRequires" and $infile->[$index][0] ne $$infile[$index - 1][0]
$infile->[$index][3] eq "TestRequires"
$infile->[$index][0] ne $$infile[$index - 1][0]
Truth table0%0/3
A and B
A= $infile->[$index][3] eq "TestRequires"B= $infile->[$index][0] ne $$infile[$index - 1][0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | and ($infile->[$index][0] ne $infile->[$index - 1][0])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | p $module if $self->debug; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | p $infile->[$index] if $self->debug; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | # found | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | return TRUE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | return FALSE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | # remove_inc_mi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | # just some belt n braces tidying up | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | ####### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | sub remove_inc_mi { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_inc_mi: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | if ($self->{format} eq 'dsl') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | delete $self->{modules}{'inc::Module::Install::DSL'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | if ($self->{format} eq 'mi') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | delete $self->{modules}{'inc::Module::Install'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 2 | ▶ | no Moo::Role; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||