| 1 | package Tangerine::hook::moduleload; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 15 | $Tangerine::hook::moduleload::VERSION = '0.21'; | |||||||||||||||||||||||||||||||||||||||||
| 3 | 15 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 15 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 15 | ▶ | use parent 'Tangerine::Hook'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 15 | ▶ | use List::Util 1.33 qw(any); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 15 | ▶ | use Tangerine::HookData; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 15 | ▶ | use Tangerine::Utils qw(stripquotelike); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | sub run { | ||||||||||||||||||||||||||||||||||||||||||
| 11 | 143 | ▶ | my ($self, $s) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 143 | my @routines = qw(load autoload load_remote autoload_remote); | |||||||||||||||||||||||||||||||||||||||||
| 13 | 143 | ▶ | if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 1 && | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
Condition83%5/6
&any(sub {
$s->[0] eq $_;
}
, "use", "no") and scalar @$s > 1 and $s->[1] eq "Module::Load"
&any(sub {
$s->[0] eq $_;
}
, "use", "no") and scalar @$s > 1
MC/DC66%2/3
&any(sub {
$s->[0] eq $_;
}
, "use", "no") and scalar @$s > 1 and $s->[1] eq "Module::Load"
&any(sub {
$s->[0] eq $_;
}
, "use", "no")
scalar @$s > 1
$s->[1] eq "Module::Load"
Truth table75%3/4
A and B and C
A= &any(sub {
$s->[0] eq $_;
}
, "use", "no")B= scalar @$s > 1C= $s->[1] eq "Module::Load"
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | $s->[1] eq 'Module::Load') { | ||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | return Tangerine::HookData->new( hooks => [ | |||||||||||||||||||||||||||||||||||||||||
| 16 | Tangerine::hook::moduleload->new(type => 'runtime') ] ); | ||||||||||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||||||||||
| 18 | 141 | ▶ | if ($self->type eq 'runtime' && (any { $s->[0] eq $_ } @routines) && | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
Condition83%5/6
$self->type eq "runtime" and &any(sub {
$s->[0] eq $_;
}
, @routines) and scalar @$s > 2
$self->type eq "runtime" and &any(sub {
$s->[0] eq $_;
}
, @routines)
MC/DC66%2/3
$self->type eq "runtime" and &any(sub {
$s->[0] eq $_;
}
, @routines) and scalar @$s > 2
$self->type eq "runtime"
&any(sub {
$s->[0] eq $_;
}
, @routines)
scalar @$s > 2
Truth table75%3/4
A and B and C
A= $self->type eq "runtime"B= &any(sub {
$s->[0] eq $_;
}
, @routines)C= scalar @$s > 2
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | scalar(@$s) > 2) | ||||||||||||||||||||||||||||||||||||||||||
| 20 | { | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 5 | print "I would return: use ".join(' ', @$s[1..$#$s])."\n"; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 5 | return Tangerine::HookData->new( | |||||||||||||||||||||||||||||||||||||||||
| 23 | children => [ 'use', stripquotelike($s->[1]), @$s[2..$#$s] ], | ||||||||||||||||||||||||||||||||||||||||||
| 24 | type => 'runtime', | ||||||||||||||||||||||||||||||||||||||||||
| 25 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 136 | return; | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | 15 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||||||||||||||||||||||||