line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Lint::Policy::ValuesAndExpressions::ProhibitImplicitNewlines; |
2
|
133
|
|
|
133
|
|
83709
|
use strict; |
|
133
|
|
|
|
|
189
|
|
|
133
|
|
|
|
|
3393
|
|
3
|
133
|
|
|
133
|
|
436
|
use warnings; |
|
133
|
|
|
|
|
170
|
|
|
133
|
|
|
|
|
3220
|
|
4
|
133
|
|
|
133
|
|
858
|
use Perl::Lint::Constants::Type; |
|
133
|
|
|
|
|
167
|
|
|
133
|
|
|
|
|
65019
|
|
5
|
133
|
|
|
133
|
|
589
|
use parent "Perl::Lint::Policy"; |
|
133
|
|
|
|
|
185
|
|
|
133
|
|
|
|
|
725
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use constant { |
8
|
133
|
|
|
|
|
22591
|
DESC => 'Literal line breaks in a string', |
9
|
|
|
|
|
|
|
EXPL => [60, 61], |
10
|
133
|
|
|
133
|
|
6876
|
}; |
|
133
|
|
|
|
|
191
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub evaluate { |
13
|
4
|
|
|
4
|
0
|
7
|
my ($class, $file, $tokens, $args) = @_; |
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
|
|
5
|
my @violations; |
16
|
4
|
|
|
|
|
13
|
for (my $i = 0; my $token = $tokens->[$i]; $i++) { |
17
|
110
|
|
|
|
|
87
|
my $token_type = $token->{type}; |
18
|
110
|
100
|
100
|
|
|
476
|
if ( |
|
|
|
100
|
|
|
|
|
19
|
|
|
|
|
|
|
$token_type == STRING || |
20
|
|
|
|
|
|
|
$token_type == RAW_STRING || |
21
|
|
|
|
|
|
|
$token_type == REG_EXP |
22
|
|
|
|
|
|
|
) { |
23
|
18
|
|
|
|
|
17
|
my $string = $token->{data}; |
24
|
18
|
100
|
|
|
|
43
|
if ($string =~ /\r?\n/) { |
25
|
|
|
|
|
|
|
push @violations, { |
26
|
|
|
|
|
|
|
filename => $file, |
27
|
|
|
|
|
|
|
line => $token->{line}, |
28
|
10
|
|
|
|
|
38
|
description => DESC, |
29
|
|
|
|
|
|
|
explanation => EXPL, |
30
|
|
|
|
|
|
|
policy => __PACKAGE__, |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
|
|
15
|
return \@violations; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|