Tangerine/hook/moduleload.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 4 / 4 Conditioncond 83.3% 10 / 12 MC/DCmcdc 66.6% 4 / 6 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 93.5% 58 / 62 CC 7 SCAR 13.4
CC
7
Cov
96%
run
7.0
__ANON__
1.0
__ANON__
1.0
CRAP 3.8
« Tangerine/Utils.pm ↑ Summary Tangerine/hook/use.pm »
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
BranchTrueFalseTotal
if (&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 1 and $s->[1] eq "Module::Load") 2 141 143
Condition83%5/6
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 1 and $s->[1] eq "Module::Load"
!ll&&!rl&&r
60812
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 1
!ll&&!rl&&r
60083
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
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
BranchTrueFalseTotal
if ($self->type eq "runtime" and &any(sub { $s->[0] eq $_; } , @routines) and scalar @$s > 2) 5 136 141
Condition83%5/6
$self->type eq "runtime" and &any(sub { $s->[0] eq $_; } , @routines) and scalar @$s > 2
!ll&&!rl&&r
13605
$self->type eq "runtime" and &any(sub { $s->[0] eq $_; } , @routines)
!ll&&!rl&&r
13155
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
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__
« Tangerine/Utils.pm ↑ Summary Tangerine/hook/use.pm »