Perl/Lint/Policy/BuiltinFunctions/RequireBlockMap.pm

filter: Statementstmt 57.1% 16 / 28 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 43.7% 21 / 48 CC 6 SCAR 31.5
CC
6
Cov
41%
evaluate
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 23.4
« Perl/Lint/Policy/BuiltinFunctions/RequireBlockGrep.pm ↑ Summary Perl/Lint/Policy/ValuesAndExpressions/ProhibitImplicitNewlines.pm »
1 package Perl::Lint::Policy::BuiltinFunctions::RequireBlockMap;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Perl::Lint::Constants::Type;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use parent "Perl::Lint::Policy";
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 DESC => 'Expression form of "map"',
9 EXPL => [169],
10 2 };
11  
12 0 ▶sub evaluate {
Subroutine evaluate: not called CC=6 SCAR=37.4
Pod undocumented
13 0 my ($class, $file, $tokens, $src, $args) = @_;
14  
15 0 my @violations;
16 0 ▶ for (my $i = 0; my $token = $tokens->[$i]; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $token = $tokens->[$i]) 0 0 0
17 0 my $token_type = $token->{type};
18 0 my $token_data = $token->{data};
19  
20 0 ▶ if ($token_type == BUILTIN_FUNC && $token_data eq 'map') {
Branch: 1 branch
BranchTrueFalseTotal
if ($token_type == 70 and $token_data eq "map") 0 0 0
Condition0%0/3
$token_type == 70 and $token_data eq "map"
!ll&&!rl&&r
000
MC/DC0%0/2
$token_type == 70 and $token_data eq "map"
$token_type == 70 $token_data eq "map"
Truth table0%0/3
A and B
A= $token_type == 70B= $token_data eq "map"
ABresult
0X0
100
111
21 0 $token = $tokens->[++$i];
22 0 $token_type = $token->{type};
23 0 ▶ if ($token_type == LEFT_PAREN) {
Branch: 2 branches
BranchTrueFalseTotal
if ($token_type == 107) { } 0 0 0
elsif ($token_type != 109) { } 0 0 0
24 0 next;
25 }
26 elsif ($token_type != LEFT_BRACE) {
27 push @violations, {
28 filename => $file,
29 line => $token->{line},
30 0 description => DESC,
31 explanation => EXPL,
32 policy => __PACKAGE__,
33 };
34 }
35 }
36 }
37  
38 0 return \@violations;
39 }
40  
41 2 1;
42  
« Perl/Lint/Policy/BuiltinFunctions/RequireBlockGrep.pm ↑ Summary Perl/Lint/Policy/ValuesAndExpressions/ProhibitImplicitNewlines.pm »