Tangerine/hook/use.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 6 / 6 Conditioncond 100% 8 / 8 MC/DCmcdc 100% 5 / 5 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 100% 60 / 60 CC 7 SCAR 13.4
CC
7
Cov
100%
run
7.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.8
« Tangerine/Utils.pm ↑ Summary Tangerine/hook/tests.pm »
1 package Tangerine::hook::use;
2 16 $Tangerine::hook::use::VERSION = '0.23';
3 16 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶use parent 'Tangerine::Hook';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 16 ▶use Tangerine::HookData;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 16 ▶use Tangerine::Occurence;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 16 ▶use Tangerine::Utils qw(any $vre);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 142 ▶sub run {
Subroutine run: called CC=7 SCAR=19.5
Pod documented
12 142 my ($self, $s) = @_;
13 142 ▶ if (scalar(@$s) > 1 && (any { $s->[0] eq $_ } qw(use no))) {
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$s > 1 and &any(sub { $s->[0] eq $_; } , "use", "no")) 85 57 142
Condition100%3/3
scalar @$s > 1 and &any(sub { $s->[0] eq $_; } , "use", "no")
!ll&&!rl&&r
45385
MC/DC100%2/2
scalar @$s > 1 and &any(sub { $s->[0] eq $_; } , "use", "no")
scalar @$s > 1 &any(sub { $s->[0] eq $_; } , "use", "no")
Truth table100%3/3
A and B
A= scalar @$s > 1B= &any(sub { $s->[0] eq $_; } , "use", "no")
ABresult
0X0
100
111
14 85 ▶ return if $s->[1] eq ';';
Branch: 1 branch
BranchTrueFalseTotal
if $s->[1] eq ";" 1 84 85
15 84 my $module = $s->[1];
16 84 ▶ my ($version) = $s->[2] && $s->[2] =~ $vre;
Condition100%3/3
$s->[2] && $s->[2] =~ /$Tangerine::hook::use::vre/
!ll&&!rl&&r
3747
MC/DC100%2/2
$s->[2] && $s->[2] =~ /$Tangerine::hook::use::vre/
$s->[2] $s->[2] =~ /$Tangerine::hook::use::vre/
Truth table100%3/3
A && B
A= $s->[2]B= $s->[2] =~ /$Tangerine::hook::use::vre/
ABresult
0X0
100
111
17 84 ▶ $version //= '';
Condition100%2/2
$version //= ""
l!l
777
MC/DC100%1/1
$version //= ""
$version
Truth table100%2/2
A
A= $version
Aresult
11
00
18 84 ▶ return Tangerine::HookData->new(
Branch: 1 branch
BranchTrueFalseTotal
unless $module =~ /^v?5(?:\..*)?$/ 83 1 84
19 modules => {
20 $module => Tangerine::Occurence->new(
21 version => $version,
22 ),
23 },
24 ) unless $module =~ /^v?5(?:\..*)?$/;
25 }
26 58 return;
27 }
28  
29 16 1;
30  
31 __END__
« Tangerine/Utils.pm ↑ Summary Tangerine/hook/tests.pm »