Tangerine/hook/testloading.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 6 / 6 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 100% 51 / 51 CC 5 SCAR 9.3
CC
5
Cov
100%
run
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« Tangerine/hook/require.pm ↑ Summary Tangerine/hook/package.pm »
1 package Tangerine::hook::testloading;
2 2 $Tangerine::hook::testloading::VERSION = '0.21';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use parent 'Tangerine::Hook';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use List::Util 1.33 qw(any);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Tangerine::HookData;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Tangerine::Occurence;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Tangerine::Utils qw(stripquotelike);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub run {
12 31 ▶ my ($self, $s) = @_;
Subroutine run: called CC=5 SCAR=16.1
Pod documented
13 31 ▶ if (scalar(@$s) > 1 && any { $s->[0] eq $_ } qw/require_ok syntax_ok use_ok/) {
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$s > 1 and &any(sub { $s->[0] eq $_; } , "require_ok", "syntax_ok", "use_ok")) 16 15 31
Condition100%3/3
scalar @$s > 1 and &any(sub { $s->[0] eq $_; } , "require_ok", "syntax_ok", "use_ok")
!ll&&!rl&&r
11416
MC/DC100%2/2
scalar @$s > 1 and &any(sub { $s->[0] eq $_; } , "require_ok", "syntax_ok", "use_ok")
scalar @$s > 1 &any(sub { $s->[0] eq $_; } , "require_ok", "syntax_ok", "use_ok")
Truth table100%3/3
A and B
A= scalar @$s > 1B= &any(sub { $s->[0] eq $_; } , "require_ok", "syntax_ok", "use_ok")
ABresult
0X0
100
111
14 16 ▶ return if $s->[1] eq ';';
Branch: 1 branch
BranchTrueFalseTotal
if $s->[1] eq ";" 3 13 16
15 13 my @modules = stripquotelike((@$s)[1..$#$s]);
16 13 ▶ return Tangerine::HookData->new(
Branch: 1 branch
BranchTrueFalseTotal
$s->[0] eq 'require_ok' ? : 3 10 13
17 children => [
18 ($s->[0] eq 'require_ok' ?
19 ('require', $modules[0]) :
20 ('use', @modules)
21 )
22  
23 ],
24 );
25 }
26 15 return;
27 }
28  
29 2 1;
30  
31 __END__
« Tangerine/hook/require.pm ↑ Summary Tangerine/hook/package.pm »