Tangerine/hook/prefixedlist.pm

filter: Statementstmt 100% 42 / 42 Branchbran 70.0% 7 / 10 Conditioncond 87.5% 7 / 8 MC/DCmcdc 75.0% 3 / 4 Subroutinesub 100% 10 / 10 Podpod 100% 1 / 1 totaltotal 93.3% 70 / 75 CC 9 SCAR 16.2
CC
9
Cov
93%
run
9.1
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« Tangerine/hook/moduleruntime.pm ↑ Summary Tangerine/hook/moduleload.pm »
1 package Tangerine::hook::prefixedlist;
2 15 $Tangerine::hook::prefixedlist::VERSION = '0.22';
3 15 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 15 ▶use parent 'Tangerine::Hook';
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::Occurence;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 15 ▶use Tangerine::Utils qw(any stripquotelike $vre);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub run {
12 137 ▶ my ($self, $s) = @_;
Subroutine run: called CC=9 SCAR=22.1
Pod documented
13 137 ▶ if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 &&
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if (&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2 and &any(sub { $s->[1] eq $_; } , "Mo", "POE", "Tk::widgets")) 9 128 137
Condition100%6/6
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2 and &any(sub { $s->[1] eq $_; } , "Mo", "POE", "Tk::widgets")
!ll&&!rl&&r
59699
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2
!ll&&!rl&&r
55478
MC/DC100%3/3
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2 and &any(sub { $s->[1] eq $_; } , "Mo", "POE", "Tk::widgets")
&any(sub { $s->[0] eq $_; } , "use", "no") scalar @$s > 2 &any(sub { $s->[1] eq $_; } , "Mo", "POE", "Tk::widgets")
Truth table100%4/4
A and B and C
A= &any(sub { $s->[0] eq $_; } , "use", "no")B= scalar @$s > 2C= &any(sub { $s->[1] eq $_; } , "Mo", "POE", "Tk::widgets")
ABCresult
0XX0
10X0
1100
1111
14 221 ▶ (any { $s->[1] eq $_ } qw(Mo POE Tk::widgets))) {
Subroutine __ANON__: called CC=1 SCAR=0.0
15 9 my ($version) = $s->[2] =~ $vre;
16 9 ▶ $version //= '';
Condition50%1/2
$version //= ""
l!l
09
MC/DC0%0/1
$version //= ""
$version
Truth table50%1/2
A
A= $version
Aresult
11
00
17 9 ▶ my $voffset = $version ? 3 : 2;
Branch: 1 branch
BranchTrueFalseTotal
$version ? : 0 9 9
18 9 my @args;
19 9 ▶ if (scalar(@$s) > $voffset) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$s > $voffset) 9 0 9
20 9 ▶ return if $s->[$voffset] eq ';';
Branch: 1 branch
BranchTrueFalseTotal
if $s->[$voffset] eq ";" 0 9 9
21 9 @args = @$s;
22 9 @args = @args[($voffset) .. $#args];
23 9 @args = stripquotelike(@args);
24 }
25 9 my $prefix;
26 9 ▶ if ($s->[1] eq 'Tk::widgets') {
Branch: 1 branch
BranchTrueFalseTotal
if ($s->[1] eq 'Tk::widgets') { } 1 8 9
27 1 $prefix = 'Tk'
28 } else {
29 8 $prefix = $s->[1]
30 }
31 return Tangerine::HookData->new(
32 modules => {
33 map {
34 9 ( $prefix.'::'.$_ => Tangerine::Occurence->new() )
35 } @args,
36 },
37 );
38 }
39 128 return;
40 }
41  
42 15 1;
43  
44 __END__
« Tangerine/hook/moduleruntime.pm ↑ Summary Tangerine/hook/moduleload.pm »