Tangerine/hook/use.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 6 / 6 Conditioncond 100% 8 / 8 MC/DCmcdc 100% 5 / 5 Subroutinesub 100% 10 / 10 Podpod 100% 1 / 1 totaltotal 100% 64 / 64 CC 7 SCAR 12.9
CC
7
Cov
100%
run
7.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.6
« Tangerine/hook/moduleload.pm ↑ Summary Tangerine/hook/tests.pm »
1 package Tangerine::hook::use;
2 15 $Tangerine::hook::use::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($vre);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub run {
13 136 ▶ my ($self, $s) = @_;
Subroutine run: called CC=7 SCAR=19.5
Pod documented
14 136 ▶ 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")) 81 55 136
Condition100%3/3
scalar @$s > 1 and &any(sub { $s->[0] eq $_; } , "use", "no")
!ll&&!rl&&r
45181
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
15 81 ▶ return if $s->[1] eq ';';
Branch: 1 branch
BranchTrueFalseTotal
if $s->[1] eq ";" 1 80 81
16 80 my $module = $s->[1];
17 80 ▶ my ($version) = $s->[2] && $s->[2] =~ $vre;
Condition100%3/3
$s->[2] && $s->[2] =~ /$Tangerine::hook::use::vre/
!ll&&!rl&&r
3716
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
18 80 ▶ $version //= '';
Condition100%2/2
$version //= ""
l!l
674
MC/DC100%1/1
$version //= ""
$version
Truth table100%2/2
A
A= $version
Aresult
11
00
19 80 ▶ return Tangerine::HookData->new(
Branch: 1 branch
BranchTrueFalseTotal
unless $module =~ /^v?5(?:\..*)?$/ 79 1 80
20 modules => {
21 $module => Tangerine::Occurence->new(
22 version => $version,
23 ),
24 },
25 ) unless $module =~ /^v?5(?:\..*)?$/;
26 }
27 56 return;
28 }
29  
30 15 1;
31  
32 __END__
« Tangerine/hook/moduleload.pm ↑ Summary Tangerine/hook/tests.pm »