Tangerine/hook/xxx.pm

filter: Statementstmt 100% 35 / 35 Branchbran 100% 10 / 10 Conditioncond 88.8% 8 / 9 MC/DCmcdc 80.0% 4 / 5 Subroutinesub 100% 10 / 10 Podpod 100% 1 / 1 totaltotal 97.1% 68 / 70 CC 9 SCAR 16.1
CC
9
Cov
98%
run
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« Tangerine/hook/moduleruntime.pm ↑ Summary Tangerine/hook/prefixedlist.pm »
1 package Tangerine::hook::xxx;
2 15 $Tangerine::hook::xxx::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/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub run {
13 132 ▶ my ($self, $s) = @_;
Subroutine run: called CC=9 SCAR=22.0
Pod documented
14 132 ▶ 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 128 132
Condition100%6/6
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2 and $s->[1] eq "XXX"
!ll&&!rl&&r
59694
&any(sub { $s->[0] eq $_; } , "use", "no") and scalar @$s > 2
!ll&&!rl&&r
55473
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
15 scalar(@$s) > 2 && $s->[1] eq 'XXX') {
16 4 my $module;
17 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
18 1 $module = 'Data::Dumper';
19 } elsif ($s->[2] eq '-yaml') {
20 1 $module = 'YAML';
21 ▶ } 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
22 1 $module = stripquotelike($s->[4]);
23 }
24 4 ▶ return Tangerine::HookData->new( modules => {
Branch: 1 branch
BranchTrueFalseTotal
if $module 3 1 4
25 $module => Tangerine::Occurence->new } )
26 if $module;
27 }
28 129 return;
29 }
30  
31 15 1;
32  
33 __END__
« Tangerine/hook/moduleruntime.pm ↑ Summary Tangerine/hook/prefixedlist.pm »