Tangerine/hook/moduleload.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 4 / 4 Conditioncond 83.3% 10 / 12 MC/DCmcdc 66.6% 4 / 6 Subroutinesub 100% 8 / 8 Podpod 100% 1 / 1 totaltotal 92.9% 53 / 57 CC 7 SCAR 13.9
CC
7
Cov
95%
run
7.0
__ANON__
1.0
__ANON__
1.0
CRAP 4.0
« Tangerine/hook/prefixedlist.pm ↑ Summary Tangerine/Utils.pm »
1 package Tangerine::hook::moduleload;
2 15 $Tangerine::hook::moduleload::VERSION = '0.22';
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 Tangerine::HookData;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 15 ▶use Tangerine::Utils qw(any stripquotelike);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub run {
10 144 ▶ my ($self, $s) = @_;
Subroutine run: called CC=7 SCAR=19.5
Pod documented
11 144 my @routines = qw(load autoload load_remote autoload_remote);
12 144 ▶ if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 1 &&
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if (&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 1 and $s->[1] eq "Module::Load") 2 142 144
Condition83%5/6
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 1 and $s->[1] eq "Module::Load"
!ll&&!rl&&r
60822
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 1
!ll&&!rl&&r
60084
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"
ABCresult
0XX0
10X0
1100
1111
13 $s->[1] eq 'Module::Load') {
14 2 return Tangerine::HookData->new( hooks => [
15 Tangerine::hook::moduleload->new(type => 'runtime') ] );
16 }
17 142 ▶ if ($self->type eq 'runtime' && (any { $s->[0] eq $_ } @routines) &&
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if ($self->type eq "runtime" and &any(sub { $s->[0] eq $_; } , @routines) and scalar @$s > 2) 5 137 142
Condition83%5/6
$self->type eq "runtime" and &any(sub { $s->[0] eq $_; } , @routines) and scalar @$s > 2
!ll&&!rl&&r
13705
$self->type eq "runtime" and &any(sub { $s->[0] eq $_; } , @routines)
!ll&&!rl&&r
13255
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
ABCresult
0XX0
10X0
1100
1111
18 scalar(@$s) > 2)
19 {
20 5 return Tangerine::HookData->new(
21 children => [ 'use', stripquotelike($s->[1]), @$s[2..$#$s] ],
22 type => 'runtime',
23 );
24 }
25 137 return;
26 }
27  
28 15 1;
29  
30 __END__
« Tangerine/hook/prefixedlist.pm ↑ Summary Tangerine/Utils.pm »