« Perl/Lint/Policy/BuiltinFunctions/ProhibitStringyEval.pm
↑ Summary
Perl/Lint/Policy/Modules/RequireVersionVar.pm »
| 1 | package Perl::Lint::Policy::RegularExpressions::ProhibitFixedStringMatches; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use Perl::Lint::Constants::Type; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use Regexp::Lexer qw(tokenize); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Regexp::Lexer::TokenType; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use parent "Perl::Lint::Policy"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 3 | ▶ | use constant { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | DESC => 'Use "eq" or hash instead of fixed-pattern regexps', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | EXPL => [271, 272], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | # to use sanitize | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 3 | my $alternation_id = Regexp::Lexer::TokenType::Alternation->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 3 | my $lparen_id = Regexp::Lexer::TokenType::LeftParenthesis->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 3 | my $rparen_id = Regexp::Lexer::TokenType::RightParenthesis->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 3 | my $question_id = Regexp::Lexer::TokenType::Question->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 3 | my $colon_id = Regexp::Lexer::TokenType::Colon->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | # to use check fixed string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 3 | my $character_id = Regexp::Lexer::TokenType::Character->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 3 | my $escaped_character_id = Regexp::Lexer::TokenType::EscapedCharacter->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | # anchors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 3 | my $beginning_of_line_id = Regexp::Lexer::TokenType::BeginningOfLine->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 3 | my $end_of_line_id = Regexp::Lexer::TokenType::EndOfLine->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 3 | my $escaped_beginning_of_line_id = Regexp::Lexer::TokenType::EscapedBeginningOfString->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 3 | my $escaped_end_of_line_id = Regexp::Lexer::TokenType::EscapedEndOfString->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 2 | ▶ | sub evaluate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
evaluate: called CC=34 SCAR=59.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | my ($class, $file, $tokens, $src, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2 | my @violations; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 2 | my $is_reg_quoted = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | ▶ | for (my $i = 0, my $token_type; my $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 51 | $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 51 | ▶ | if ($token_type == REG_EXP || $token_type == REG_REPLACE_FROM) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
$token_type == 187 or $token_type == 156
MC/DC50%1/2
$token_type == 187 or $token_type == 156
$token_type == 187
$token_type == 156
Truth table66%2/3
A or B
A= $token_type == 187B= $token_type == 156
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 2 | ▶ | if ($is_reg_quoted) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | $is_reg_quoted = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 2 | my $maybe_regopt; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 2 | ▶ | if ($token_type == REG_EXP) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 2 | $maybe_regopt = $tokens->[$i+2]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | $maybe_regopt = $tokens->[$i+4]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if ($maybe_regopt->{type} == REG_DELIM) { # if it use brackets as delimiter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | $maybe_regopt = $tokens->[$i+5]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 2 | my $is_with_m_opt = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 2 | ▶ | if ($maybe_regopt) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 2 | ▶ | if ($maybe_regopt->{type} == REG_OPT && $maybe_regopt->{data} =~ /m/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$maybe_regopt->{"type"} == 144 and $maybe_regopt->{"data"} =~ /m/
MC/DC0%0/2
$maybe_regopt->{"type"} == 144 and $maybe_regopt->{"data"} =~ /m/
$maybe_regopt->{"type"} == 144
$maybe_regopt->{"data"} =~ /m/
Truth table33%1/3
A and B
A= $maybe_regopt->{"type"} == 144B= $maybe_regopt->{"data"} =~ /m/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | $is_with_m_opt = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 2 | my @regexp_tokens = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 2 | @{tokenize(qr/$token->{data}/)->{tokens}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 2 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | # XXX First aid! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | # Maybe regexp is produced by `tr///` or `y///` operator if it reaches here. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 2 | ▶ | if (scalar @regexp_tokens < 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 2 | my $first_token_type_id = (shift @regexp_tokens)->{type}->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | my $last_token_type_id = (pop @regexp_tokens)->{type}->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 2 | ▶ | if (defined $first_token_type_id && defined $last_token_type_id) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $first_token_type_id and defined $last_token_type_id
MC/DC0%0/2
defined $first_token_type_id and defined $last_token_type_id
defined $first_token_type_id
defined $last_token_type_id
Truth table33%1/3
A and B
A= defined $first_token_type_idB= defined $last_token_type_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 2 | ▶ | if ($is_with_m_opt) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | if ($first_token_type_id == $beginning_of_line_id || $last_token_type_id == $end_of_line_id) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$first_token_type_id == $beginning_of_line_id or $last_token_type_id == $end_of_line_id
MC/DC0%0/2
$first_token_type_id == $beginning_of_line_id or $last_token_type_id == $end_of_line_id
$first_token_type_id == $beginning_of_line_id
$last_token_type_id == $end_of_line_id
Truth table0%0/3
A or B
A= $first_token_type_id == $beginning_of_line_idB= $last_token_type_id == $end_of_line_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 2 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition22%2/9
$first_token_type_id == $beginning_of_line_id || $first_token_type_id == $escaped_beginning_of_line_id and $last_token_type_id == $end_of_line_id || $last_token_type_id == $escaped_end_of_line_id
$first_token_type_id == $beginning_of_line_id or $first_token_type_id == $escaped_beginning_of_line_id
$last_token_type_id == $end_of_line_id or $last_token_type_id == $escaped_end_of_line_id
MC/DC0%0/4
$first_token_type_id == $beginning_of_line_id || $first_token_type_id == $escaped_beginning_of_line_id and $last_token_type_id == $end_of_line_id || $last_token_type_id == $escaped_end_of_line_id
$first_token_type_id == $beginning_of_line_id
$first_token_type_id == $escaped_beginning_of_line_id
$last_token_type_id == $end_of_line_id
$last_token_type_id == $escaped_end_of_line_id
Truth table14%1/7
A or B and C or D
A= $first_token_type_id == $beginning_of_line_idB= $first_token_type_id == $escaped_beginning_of_line_idC= $last_token_type_id == $end_of_line_idD= $last_token_type_id == $escaped_end_of_line_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | ($first_token_type_id == $beginning_of_line_id || $first_token_type_id == $escaped_beginning_of_line_id) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | ($last_token_type_id == $end_of_line_id || $last_token_type_id == $escaped_end_of_line_id) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | my @not_character_tokens = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | for (my $j = 0, my $type_id; my $regexp_token = $regexp_tokens[$j]; $j++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | $type_id = $regexp_token->{type}->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$type_id == $alternation_id or $type_id == $rparen_id
MC/DC0%0/2
$type_id == $alternation_id or $type_id == $rparen_id
$type_id == $alternation_id
$type_id == $rparen_id
Truth table0%0/3
A or B
A= $type_id == $alternation_idB= $type_id == $rparen_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | $type_id == $alternation_id || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | $type_id == $rparen_id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | if ($type_id == $lparen_id) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | my $next_regexp_token = $regexp_tokens[$j+1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | if (defined $next_regexp_token && $next_regexp_token->{type}->{id} == $question_id) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $next_regexp_token and $next_regexp_token->{"type"}{"id"} == $question_id
MC/DC0%0/2
defined $next_regexp_token and $next_regexp_token->{"type"}{"id"} == $question_id
defined $next_regexp_token
$next_regexp_token->{"type"}{"id"} == $question_id
Truth table0%0/3
A and B
A= defined $next_regexp_tokenB= $next_regexp_token->{"type"}{"id"} == $question_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $next_regexp_token = $regexp_tokens[$j+2]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | if (defined $next_regexp_token && $next_regexp_token->{type}->{id} == $colon_id) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $next_regexp_token and $next_regexp_token->{"type"}{"id"} == $colon_id
MC/DC0%0/2
defined $next_regexp_token and $next_regexp_token->{"type"}{"id"} == $colon_id
defined $next_regexp_token
$next_regexp_token->{"type"}{"id"} == $colon_id
Truth table0%0/3
A and B
A= defined $next_regexp_tokenB= $next_regexp_token->{"type"}{"id"} == $colon_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | $j += 2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | if ($type_id != $character_id && $type_id != $escaped_character_id) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$type_id != $character_id and $type_id != $escaped_character_id
MC/DC0%0/2
$type_id != $character_id and $type_id != $escaped_character_id
$type_id != $character_id
$type_id != $escaped_character_id
Truth table0%0/3
A and B
A= $type_id != $character_idB= $type_id != $escaped_character_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | push @not_character_tokens, $regexp_token; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | if (@not_character_tokens) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | push @violations, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | filename => $file, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | line => $token->{line}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | description => DESC, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | explanation => EXPL, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | ▶ | elsif ($token_type == REG_QUOTE || $token_type == REG_DOUBLE_QUOTE) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$token_type == 145 or $token_type == 146
MC/DC0%0/2
$token_type == 145 or $token_type == 146
$token_type == 145
$token_type == 146
Truth table33%1/3
A or B
A= $token_type == 145B= $token_type == 146
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $is_reg_quoted = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 2 | return \@violations; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||