Perl/Lint/Policy/ValuesAndExpressions/ProhibitImplicitNewlines.pm

filter: Statementstmt 64.0% 16 / 25 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 44.6% 21 / 47 CC 6 SCAR 31.5
CC
6
Cov
43%
evaluate
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 23.4
« Perl/Lint/Policy/BuiltinFunctions/RequireBlockMap.pm ↑ Summary Perl/Lint/Policy/BuiltinFunctions/RequireGlobFunction.pm »
1 package Perl::Lint::Policy::ValuesAndExpressions::ProhibitImplicitNewlines;
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 => 'Literal line breaks in a string',
9 EXPL => [60, 61],
10 2 };
11  
12 0 ▶sub evaluate {
Subroutine evaluate: not called CC=6 SCAR=37.4
Pod undocumented
13 0 my ($class, $file, $tokens, $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 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if ($token_type == 172 or $token_type == 173 or $token_type == 187) 0 0 0
Condition0%0/6
$token_type == 172 or $token_type == 173 or $token_type == 187
l!l&&r!l&&!r
000
$token_type == 172 or $token_type == 173
l!l&&r!l&&!r
000
MC/DC0%0/3
$token_type == 172 or $token_type == 173 or $token_type == 187
$token_type == 172 $token_type == 173 $token_type == 187
Truth table0%0/4
A or B or C
A= $token_type == 172B= $token_type == 173C= $token_type == 187
ABCresult
1XX1
01X1
0011
0000
19 $token_type == STRING ||
20 $token_type == RAW_STRING ||
21 $token_type == REG_EXP
22 ) {
23 0 my $string = $token->{data};
24 0 ▶ if ($string =~ /\r?\n/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($string =~ /\r?\n/) 0 0 0
25 push @violations, {
26 filename => $file,
27 line => $token->{line},
28 0 description => DESC,
29 explanation => EXPL,
30 policy => __PACKAGE__,
31 };
32 }
33 }
34 }
35  
36 0 return \@violations;
37 }
38  
39 2 1;
40  
« Perl/Lint/Policy/BuiltinFunctions/RequireBlockMap.pm ↑ Summary Perl/Lint/Policy/BuiltinFunctions/RequireGlobFunction.pm »