« 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
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$token_type == 172 or $token_type == 173 or $token_type == 187
$token_type == 172 or $token_type == 173
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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||||||||||||||||