| 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
Condition100%3/3
scalar @$s > 1 and &any(sub {
$s->[0] eq $_;
}
, "use", "no")
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")
| |||||||||||||||||||||||||||||
| 14 | 85 | ▶ | return if $s->[1] eq ';'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 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/
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/
| |||||||||||||||||||||||||||||
| 17 | 84 | ▶ | $version //= ''; | ||||||||||||||||||||||||||
|
Condition100%2/2
$version //= ""
MC/DC100%1/1
$version //= ""
$version
Truth table100%2/2
A
A= $version
| |||||||||||||||||||||||||||||
| 18 | 84 | ▶ | return Tangerine::HookData->new( | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||