« Perl/Lint/Policy/InputOutput/RequireCheckedSyscalls.pm
↑ Summary
Perl/Lint/Policy/Variables/RequireLocalizedPunctuationVars.pm »
| 1 | package Perl::Lint::Policy::RegularExpressions::RequireExtendedFormatting; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 => 'Regular expression without "/x" flag', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | EXPL => [236], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub evaluate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
evaluate: not called CC=46 SCAR=76.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | my ($class, $file, $tokens, $src, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | my $require_extended_formatting_arg = $args->{require_extended_formatting}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | my $minimum_regex_length_to_complain_about = $require_extended_formatting_arg->{minimum_regex_length_to_complain_about} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$require_extended_formatting_arg->{'minimum_regex_length_to_complain_about'} || 0
MC/DC0%0/1
$require_extended_formatting_arg->{'minimum_regex_length_to_complain_about'} || 0
$require_extended_formatting_arg->{'minimum_regex_length_to_complain_about'}
Truth table0%0/2
A
A= $require_extended_formatting_arg->{'minimum_regex_length_to_complain_about'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | my $strict = $require_extended_formatting_arg->{strict} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$require_extended_formatting_arg->{'strict'} || 0
MC/DC0%0/1
$require_extended_formatting_arg->{'strict'} || 0
$require_extended_formatting_arg->{'strict'}
Truth table0%0/2
A
A= $require_extended_formatting_arg->{'strict'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my @violations; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | my $depth = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $is_non_target_reg = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | my $enabled_re_x_depth = -1; # use negative value as default | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | my @enabled_re_x_depths; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | my $disabled_re_x_depth = -1; # use negative value as default | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | my @disabled_re_x_depths; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | for (my $i = 0; my $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | my $token_data = $token->{data}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | my $next_token = $tokens->[$i+1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | my $next_token_type = $next_token->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | my $next_token_data = $next_token->{data}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | if (!$is_non_target_reg && $token_type == REG_DELIM) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $is_non_target_reg and $token_type == 151
MC/DC0%0/2
not $is_non_target_reg and $token_type == 151
not $is_non_target_reg
$token_type == 151
Truth table0%0/3
not(A) and B
A= not $is_non_target_regB= $token_type == 151
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
defined $next_token_type and $next_token_type == 106 || $next_token_type == 144 && !($next_token_data =~ /x/)
$next_token_type == 106 or $next_token_type == 144 and not $next_token_data =~ /x/
$next_token_type == 144 and not $next_token_data =~ /x/
MC/DC0%0/4
defined $next_token_type and $next_token_type == 106 || $next_token_type == 144 && !($next_token_data =~ /x/)
defined $next_token_type
$next_token_type == 106
$next_token_type == 144
not $next_token_data =~ /x/
Truth table0%0/5
A and B or C and not(D)
A= defined $next_token_typeB= $next_token_type == 106C= $next_token_type == 144D= not $next_token_data =~ /x/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | defined $next_token_type && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | $next_token_type == SEMI_COLON || # when any regex options don't exist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | ($next_token_type == REG_OPT && $next_token_data !~ /x/) # when the `x` regex option doesn't exist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
not $enabled_re_x_depth >= 0 && $depth >= $enabled_re_x_depth or $disabled_re_x_depth >= 0 and $disabled_re_x_depth > $enabled_re_x_depth
$enabled_re_x_depth >= 0 && $depth >= $enabled_re_x_depth
$disabled_re_x_depth >= 0 and $disabled_re_x_depth > $enabled_re_x_depth
MC/DC0%0/4
not $enabled_re_x_depth >= 0 && $depth >= $enabled_re_x_depth or $disabled_re_x_depth >= 0 and $disabled_re_x_depth > $enabled_re_x_depth
$enabled_re_x_depth >= 0
$depth >= $enabled_re_x_depth
$disabled_re_x_depth >= 0
$disabled_re_x_depth > $enabled_re_x_depth
Truth table0%0/5
not(A && B) or C and D
A= $enabled_re_x_depth >= 0B= $depth >= $enabled_re_x_depthC= $disabled_re_x_depth >= 0D= $disabled_re_x_depth > $enabled_re_x_depth
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | !($enabled_re_x_depth >= 0 && $depth >= $enabled_re_x_depth) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | ($disabled_re_x_depth >= 0 && $disabled_re_x_depth > $enabled_re_x_depth) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | push @violations, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | filename => $file, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | line => $token->{line}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | description => DESC, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | explanation => EXPL, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # Ignore regexes which are unnecessary to check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | # XXX more? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$token_type == 154 or $token_type == 147 or $token_type == 145 or $token_type == 148
$token_type == 154 or $token_type == 147 or $token_type == 145
$token_type == 154 or $token_type == 147
MC/DC0%0/4
$token_type == 154 or $token_type == 147 or $token_type == 145 or $token_type == 148
$token_type == 154
$token_type == 147
$token_type == 145
$token_type == 148
Truth table0%0/5
A or B or C or D
A= $token_type == 154B= $token_type == 147C= $token_type == 145D= $token_type == 148
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | $token_type == REG_ALL_REPLACE || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | $token_type == REG_LIST || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | $token_type == REG_QUOTE || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | $token_type == REG_EXEC | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | $is_non_target_reg = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | if ($token_type == SEMI_COLON) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | $is_non_target_reg = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | if ($token_type == REG_EXP || $token_type == REG_REPLACE_FROM) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$token_type == 187 or $token_type == 156
MC/DC0%0/2
$token_type == 187 or $token_type == 156
$token_type == 187
$token_type == 156
Truth table0%0/3
A or B
A= $token_type == 187B= $token_type == 156
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | if (length $token_data <= $minimum_regex_length_to_complain_about) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | $is_non_target_reg = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | # Represent block scope hierarchy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | if ($token_type == LEFT_BRACE) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | $depth++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | if ($token_type == RIGHT_BRACE) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | if ($enabled_re_x_depth == $depth) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | pop @enabled_re_x_depths; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | $enabled_re_x_depth = $enabled_re_x_depths[-1] // -1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$enabled_re_x_depths[-1] // -1
MC/DC0%0/1
$enabled_re_x_depths[-1] // -1
$enabled_re_x_depths[-1]
Truth table0%0/2
A
A= $enabled_re_x_depths[-1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | if ($disabled_re_x_depth == $depth) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | pop @disabled_re_x_depths; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | $disabled_re_x_depth = $disabled_re_x_depths[-1] // -1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$disabled_re_x_depths[-1] // -1
MC/DC0%0/1
$disabled_re_x_depths[-1] // -1
$disabled_re_x_depths[-1]
Truth table0%0/2
A
A= $disabled_re_x_depths[-1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | $depth--; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | # for | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | # `use re qw{/x}` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | # `use re '/x'` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | if ($token_type == USED_NAME && $token_data eq 're') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$token_type == 94 and $token_data eq "re"
MC/DC0%0/2
$token_type == 94 and $token_data eq "re"
$token_type == 94
$token_data eq "re"
Truth table0%0/3
A and B
A= $token_type == 94B= $token_data eq "re"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | for ($i++; $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | $token_data = $token->{data}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | if ($token_type == SEMI_COLON) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$token_type == 173 || $token_type == 172 || $token_type == 187 and $token_data =~ /x/
$token_type == 173 or $token_type == 172 or $token_type == 187
$token_type == 173 or $token_type == 172
MC/DC0%0/4
$token_type == 173 || $token_type == 172 || $token_type == 187 and $token_data =~ /x/
$token_type == 173
$token_type == 172
$token_type == 187
$token_data =~ /x/
Truth table0%0/7
A or B or C and D
A= $token_type == 173B= $token_type == 172C= $token_type == 187D= $token_data =~ /x/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | ($token_type == RAW_STRING || $token_type == STRING || $token_type == REG_EXP) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | $token_data =~ /x/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | push @enabled_re_x_depths, $depth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | $enabled_re_x_depth = $depth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | # for | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | # `no re qw{/x}` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | # `no re '/x'` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$token_type == 70 and $token_data eq "no" and $next_token_type == 122 and $next_token_data eq "re"
$token_type == 70 and $token_data eq "no" and $next_token_type == 122
$token_type == 70 and $token_data eq "no"
MC/DC0%0/4
$token_type == 70 and $token_data eq "no" and $next_token_type == 122 and $next_token_data eq "re"
$token_type == 70
$token_data eq "no"
$next_token_type == 122
$next_token_data eq "re"
Truth table0%0/5
A and B and C and D
A= $token_type == 70B= $token_data eq "no"C= $next_token_type == 122D= $next_token_data eq "re"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | $token_type == BUILTIN_FUNC && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | $token_data eq 'no' && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | $next_token_type == KEY && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | $next_token_data eq 're' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | for ($i++; $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | $token_data = $token->{data}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | if ($token_type == SEMI_COLON) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$token_type == 173 || $token_type == 172 || $token_type == 187 and $token_data =~ /x/
$token_type == 173 or $token_type == 172 or $token_type == 187
$token_type == 173 or $token_type == 172
MC/DC0%0/4
$token_type == 173 || $token_type == 172 || $token_type == 187 and $token_data =~ /x/
$token_type == 173
$token_type == 172
$token_type == 187
$token_data =~ /x/
Truth table0%0/7
A or B or C and D
A= $token_type == 173B= $token_type == 172C= $token_type == 187D= $token_data =~ /x/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | ($token_type == RAW_STRING || $token_type == STRING || $token_type == REG_EXP) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | $token_data =~ /x/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | push @disabled_re_x_depths, $depth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $disabled_re_x_depth = $depth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | return \@violations; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||