Tangerine/hook/xxx.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 10 / 10 Conditioncond 88.8% 8 / 9 MC/DCmcdc 80.0% 4 / 5 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 96.9% 64 / 66 CC 9 SCAR 16.6
CC
9
Cov
98%
run
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.2
« Tangerine/hook/inline.pm ↑ Summary Tangerine/hook/moduleruntime.pm »
1 package Tangerine::hook::xxx;
2 15 $Tangerine::hook::xxx::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/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub run {
12 133 ▶ my ($self, $s) = @_;
Subroutine run: called CC=9 SCAR=22.0
Pod documented
13 133 ▶ if ((any { $s->[0] eq $_ } qw(use no)) &&
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 $s->[1] eq "XXX") 4 129 133
Condition100%6/6
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2 and $s->[1] eq "XXX"
!ll&&!rl&&r
59704
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2
!ll&&!rl&&r
55474
MC/DC100%3/3
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2 and $s->[1] eq "XXX"
&any(sub { $s->[0] eq $_; } , "use", "no") scalar @$s > 2 $s->[1] eq "XXX"
Truth table100%4/4
A and B and C
A= &any(sub { $s->[0] eq $_; } , "use", "no")B= scalar @$s > 2C= $s->[1] eq "XXX"
ABCresult
0XX0
10X0
1100
1111
14 scalar(@$s) > 2 && $s->[1] eq 'XXX') {
15 4 my $module;
16 4 ▶ if ($s->[2] eq '-dumper') {
Branch: 3 branches
BranchTrueFalseTotal
if ($s->[2] eq '-dumper') { } 1 3 4
elsif ($s->[2] eq '-yaml') { } 1 2 3
elsif ($s->[2] eq '-with' and $s->[4]) { } 1 2 3
17 1 $module = 'Data::Dumper';
18 } elsif ($s->[2] eq '-yaml') {
19 1 $module = 'YAML';
20 ▶ } elsif ($s->[2] eq '-with' && $s->[4]) {
Condition66%2/3
$s->[2] eq "-with" and $s->[4]
!ll&&!rl&&r
101
MC/DC50%1/2
$s->[2] eq "-with" and $s->[4]
$s->[2] eq "-with" $s->[4]
Truth table66%2/3
A and B
A= $s->[2] eq "-with"B= $s->[4]
ABresult
0X0
100
111
21 1 $module = stripquotelike($s->[4]);
22 }
23 4 ▶ return Tangerine::HookData->new( modules => {
Branch: 1 branch
BranchTrueFalseTotal
if $module 3 1 4
24 $module => Tangerine::Occurence->new } )
25 if $module;
26 }
27 130 return;
28 }
29  
30 15 1;
31  
32 __END__
« Tangerine/hook/inline.pm ↑ Summary Tangerine/hook/moduleruntime.pm »