Tangerine/hook/prefixedlist.pm

filter: Statementstmt 100% 45 / 45 Branchbran 70.0% 7 / 10 Conditioncond 87.5% 7 / 8 MC/DCmcdc 75.0% 3 / 4 Subroutinesub 100% 11 / 11 Podpod 100% 1 / 1 totaltotal 93.6% 74 / 79 CC 9 SCAR 15.8
CC
9
Cov
94%
run
9.1
BEGIN
1.0
BEGIN
1.0
CRAP 4.8
« Tangerine/hook/xxx.pm ↑ Summary Tangerine/Utils.pm »
1 package Tangerine::hook::prefixedlist;
2 15 $Tangerine::hook::prefixedlist::VERSION = '0.21';
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 List::Util 1.33 qw(any);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 15 ▶use Tangerine::HookData;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 15 ▶use Tangerine::Occurence;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 15 ▶use Tangerine::Utils qw(stripquotelike $vre);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub run {
13 136 ▶ my ($self, $s) = @_;
Subroutine run: called CC=9 SCAR=22.1
Pod documented
14 136 ▶ 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 127 136
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
59689
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2
!ll&&!rl&&r
55477
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
15 218 ▶ (any { $s->[1] eq $_ } qw(Mo POE Tk::widgets))) {
Subroutine __ANON__: called CC=1 SCAR=0.0
16 9 my ($version) = $s->[2] =~ $vre;
17 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
18 9 ▶ my $voffset = $version ? 3 : 2;
Branch: 1 branch
BranchTrueFalseTotal
$version ? : 0 9 9
19 9 my @args;
20 9 ▶ if (scalar(@$s) > $voffset) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$s > $voffset) 9 0 9
21 9 ▶ return if $s->[$voffset] eq ';';
Branch: 1 branch
BranchTrueFalseTotal
if $s->[$voffset] eq ";" 0 9 9
22 9 @args = @$s;
23 9 @args = @args[($voffset) .. $#args];
24 9 @args = stripquotelike(@args);
25 }
26 9 my $prefix;
27 9 ▶ if ($s->[1] eq 'Tk::widgets') {
Branch: 1 branch
BranchTrueFalseTotal
if ($s->[1] eq 'Tk::widgets') { } 1 8 9
28 1 $prefix = 'Tk'
29 } else {
30 8 $prefix = $s->[1]
31 }
32 return Tangerine::HookData->new(
33 modules => {
34 map {
35 9 ( $prefix.'::'.$_ => Tangerine::Occurence->new() )
36 } @args,
37 },
38 );
39 }
40 127 return;
41 }
42  
43 15 1;
44  
45 __END__
« Tangerine/hook/xxx.pm ↑ Summary Tangerine/Utils.pm »