| 1 | package Tangerine::hook::prefixedlist; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 15 | $Tangerine::hook::prefixedlist::VERSION = '0.22'; | |||||||||||||||||||||||||||||||||||||||||
| 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 Tangerine::HookData; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 15 | ▶ | use Tangerine::Occurence; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 15 | ▶ | use Tangerine::Utils qw(any stripquotelike $vre); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | sub run { | ||||||||||||||||||||||||||||||||||||||||||
| 12 | 137 | ▶ | my ($self, $s) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: called CC=9 SCAR=22.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 137 | ▶ | if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 && | ||||||||||||||||||||||||||||||||||||||||
|
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 &any(sub {
$s->[1] eq $_;
}
, "Mo", "POE", "Tk::widgets")
&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 &any(sub {
$s->[1] eq $_;
}
, "Mo", "POE", "Tk::widgets")
&any(sub {
$s->[0] eq $_;
}
, "use", "no")
scalar @$s > 2
&any(sub {
$s->[1] eq $_;
}
, "Mo", "POE", "Tk::widgets")
Truth table100%4/4
A and B and C
A= &any(sub {
$s->[0] eq $_;
}
, "use", "no")B= scalar @$s > 2C= &any(sub {
$s->[1] eq $_;
}
, "Mo", "POE", "Tk::widgets")
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 221 | ▶ | (any { $s->[1] eq $_ } qw(Mo POE Tk::widgets))) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 9 | my ($version) = $s->[2] =~ $vre; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 9 | ▶ | $version //= ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$version //= ""
MC/DC0%0/1
$version //= ""
$version
Truth table50%1/2
A
A= $version
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 9 | ▶ | my $voffset = $version ? 3 : 2; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 9 | my @args; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 9 | ▶ | if (scalar(@$s) > $voffset) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 9 | ▶ | return if $s->[$voffset] eq ';'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 9 | @args = @$s; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 9 | @args = @args[($voffset) .. $#args]; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 9 | @args = stripquotelike(@args); | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 9 | my $prefix; | |||||||||||||||||||||||||||||||||||||||||
| 26 | 9 | ▶ | if ($s->[1] eq 'Tk::widgets') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | $prefix = 'Tk' | |||||||||||||||||||||||||||||||||||||||||
| 28 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 8 | $prefix = $s->[1] | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | return Tangerine::HookData->new( | ||||||||||||||||||||||||||||||||||||||||||
| 32 | modules => { | ||||||||||||||||||||||||||||||||||||||||||
| 33 | map { | ||||||||||||||||||||||||||||||||||||||||||
| 34 | 9 | ( $prefix.'::'.$_ => Tangerine::Occurence->new() ) | |||||||||||||||||||||||||||||||||||||||||
| 35 | } @args, | ||||||||||||||||||||||||||||||||||||||||||
| 36 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 37 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 128 | return; | |||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | 15 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||||||||||||||||