| 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
Condition100%6/6
&any(sub {
$s->[0] eq $_;
}
, "use", "no") and scalar @$s > 2 and $s->[1] eq "XXX"
&any(sub {
$s->[0] eq $_;
}
, "use", "no") and scalar @$s > 2
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"
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | scalar(@$s) > 2 && $s->[1] eq 'XXX') { | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 4 | my $module; | |||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | ▶ | if ($s->[2] eq '-dumper') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 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]
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]
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | $module = stripquotelike($s->[4]); | |||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 4 | ▶ | return Tangerine::HookData->new( modules => { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | $module => Tangerine::Occurence->new } ) | ||||||||||||||||||||||||||||||||||||||||||
| 26 | if $module; | ||||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 129 | return; | |||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 15 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | __END__ | ||||||||||||||||||||||||||||||||||||||||||