Perl/Lint/Policy/BuiltinFunctions/RequireGlobFunction.pm

filter: Statementstmt 59.2% 16 / 27 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 47.7% 21 / 44 CC 6 SCAR 31.5
CC
6
Cov
43%
evaluate
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 23.4
« Perl/Lint/Policy/ValuesAndExpressions/ProhibitImplicitNewlines.pm ↑ Summary Perl/Lint/Policy/Modules/RequireFilenameMatchesPackage.pm »
1 package Perl::Lint::Policy::BuiltinFunctions::RequireGlobFunction;
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 => 'Glob written as <...>',
9 EXPL => [167],
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  
19 0 ▶ if ($token_type == HANDLE_DELIM) {
Branch: 1 branch
BranchTrueFalseTotal
if ($token_type == 152) 0 0 0
20 0 ▶ for ($i++; my $token = $tokens->[$i]; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $token = $tokens->[$i]) 0 0 0
21 0 my $token_type = $token->{type};
22  
23 0 ▶ if ($token_type == MUL) {
Branch: 2 branches
BranchTrueFalseTotal
if ($token_type == 3) { } 0 0 0
elsif ($token_type == 7) { } 0 0 0
24 push @violations, {
25 filename => $file,
26 line => $token->{line},
27 0 description => DESC,
28 explanation => EXPL,
29 policy => __PACKAGE__,
30 };
31 }
32 elsif ($token_type == GREATER) {
33 0 last;
34 }
35 }
36 }
37 }
38  
39 0 return \@violations;
40 }
41  
42 2 1;
43  
« Perl/Lint/Policy/ValuesAndExpressions/ProhibitImplicitNewlines.pm ↑ Summary Perl/Lint/Policy/Modules/RequireFilenameMatchesPackage.pm »