Branch Coverage

blib/lib/Perl/Lint/Policy/RegularExpressions/ProhibitUnusedCapture.pm
Criterion Covered Total %
branch 266 360 73.8


line true false branch
51 3 1505 if ($token_type == 94 and $token_data eq 'English')
58 9 1496 if ($ignore_reg_op{$token_type})
63 63 1433 if ($token_type == 65)
64 0 63 unless $token = $$tokens[$i - 1]
69 13 50 if ($token_type == 194 or $token_type == 191 or $token_type == 166) { }
11 39 elsif ($token_type == 195 or $token_type == 192 or $token_type == 168) { }
1 38 elsif ($token_type == 196 or $token_type == 193 or $token_type == 169) { }
34 4 elsif ($token_type == 108) { }
93 0 34 unless $token = $$tokens[$i - 2]
95 2 32 if ($token_type == 107) { }
1 31 elsif ($token_type == 207) { }
99 0 1 unless $token = $$tokens[$i - 3]
101 1 0 if ($token_type == 107)
107 0 63 unless $token = $$tokens[$i + 1]
109 2 61 if ($token_type == 109 or $token_type == 111)
116 169 1264 if ($token_type == 106)
121 2 1262 if ($token_type == 36)
126 3 1259 if ($token_type == 146)
132 28 1234 if ($token_type == 172 or $token_type == 181)
137 7 76 if ($escaped)
138 0 7 if ($char =~ /[0-9]/)
146 7 69 if ($is_var)
147 0 7 if ($char =~ /[a-zA-Z_]/)
150 0 0 unless ($char =~ /[0-9a-zA-Z_]/)
157 0 0 if (not $is_used_english) { }
0 0 elsif ($var_name eq 'LAST_PAREN_MATCH' or $var_name eq 'LAST_MATCH_END' or $var_name eq 'LAST_MATCH_START') { }
172 1 6 if ($char eq '{')
175 1 1 if ($char eq '}') { }
186 3 3 if ($char =~ /[0-9]/) { }
3 0 elsif ($char eq '+' or $char eq '-') { }
198 0 3 unless $char = $chars[++$j]
199 2 1 if ($char eq '[')
205 0 8 if ($char eq $begin_delimiter) { }
3 5 elsif ($char eq $end_delimiter) { }
5 0 elsif ($char ne ' ') { }
209 3 0 if --$lbnum <= 0
216 2 1 if ($begin_delimiter eq '[') { }
217 2 0 if $captured_name > 0
221 2 0 if (my $hit = $num_vars[$captured_name])
234 7 62 if ($char eq '\\')
239 6 56 if ($char eq '$')
247 22 1212 if ($token_type == 157)
252 2 101 if ($escaped)
253 1 1 if ($re_char =~ /[0-9]/)
261 30 71 if ($is_var)
262 11 19 if ($re_char =~ /[a-zA-Z_]/)
265 11 148 unless ($re_char =~ /[0-9a-zA-Z_]/)
272 6 5 if (not $is_used_english) { }
5 0 elsif ($var_name eq 'LAST_PAREN_MATCH' or $var_name eq 'LAST_MATCH_END' or $var_name eq 'LAST_MATCH_START') { }
287 2 22 if ($re_char eq '{')
290 2 5 if ($re_char eq '}') { }
301 7 15 if ($re_char =~ /[0-9]/) { }
10 5 elsif ($re_char eq '+' or $re_char eq '-') { }
313 0 10 unless $re_char = $re_chars[++$j]
314 8 2 if ($re_char eq '[')
320 10 44 if ($re_char eq $begin_delimiter) { }
10 34 elsif ($re_char eq $end_delimiter) { }
18 16 elsif ($re_char ne ' ') { }
324 0 10 if --$lbnum <= 0
331 8 2 if ($begin_delimiter eq '[') { }
332 4 4 if $captured_name > 0
336 8 0 if (my $hit = $num_vars[$captured_name])
349 2 69 if ($re_char eq '\\')
354 23 46 if ($re_char eq '$')
363 90 1122 if ($token_type == 187 or $token_type == 156)
364 10 80 if (defined $captured_for_each_scope[$sub_depth] and %{$captured_for_each_scope[$sub_depth];})
383 38 570 if ($escaped)
384 1 37 if ($re_char =~ /[0-9]/)
392 38 532 if ($re_char eq '\\')
397 3 529 if ($re_char eq '[')
402 6 523 if ($lbnum > 0)
403 3 3 if ($re_char eq ']')
411 113 410 if ($re_char eq '(')
414 18 95 if ($re_chars[$j + 1] eq '?') { }
95 0 elsif ($re_chars[$j + 1] ne '?' or $re_chars[$j + 2] ne ':') { }
417 3 15 if ($delimiter eq ':')
421 3 12 if ($delimiter eq 'P')
426 15 0 if ($delimiter eq '<' or $delimiter eq q['])
428 15 45 if ($delimiter eq '<' and $re_char eq '>' or $delimiter eq q['] and $re_char eq q['])
438 0 15 if ($reg_not_ctx) { }
454 2 93 if ($reg_not_ctx) { }
471 33 57 if ($assign_ctx ne 'NONE')
474 8 25 if ($assign_ctx eq 'UNLIMITED_ARRAY')
475 0 8 unless $captured
8 0 if (%{{} unless $captured;})
476 6 2 if (all sub { substr($_, 0, 1) eq '$'; } , keys %$captured)
485 0 25 unless my $maybe_reg_opt = $$tokens[$i + 2]
486 6 19 if ($$maybe_reg_opt{'type'} == 144)
487 2 4 if ($assign_ctx ne 'UNLIMITED' and $$maybe_reg_opt{'data'} =~ /g/)
506 78 1044 if ($token_type == 70)
507 7 71 if ($token_data eq 'grep' or $token_data eq 'map')
508 0 7 unless $token = $$tokens[++$i]
511 0 7 if ($token_type == 107) { }
515 0 0 if ($token_type == 107) { }
0 0 elsif ($token_type == 108) { }
519 0 0 if --$lpnum <= 0
525 7 71 if ($$token{'type'} == 106)
535 15 1029 if ($token_type == 70 or $token_type == 64 or $token_type == 122)
541 0 86 unless $token = $$tokens[$j]
543 10 76 if ($token_type == 107) { }
547 0 122 if ($token_type == 107) { }
10 112 elsif ($token_type == 108) { }
3 109 elsif ($token_type == 187) { }
551 10 0 if --$lpnum <= 0
561 75 291 if ($token_type == 106) { }
9 282 elsif ($token_type == 187) { }
573 0 1002 if ($token_type == 96 or $token_type == 98 or $token_type == 99)
578 0 27 unless $token = $$tokens[++$i]
584 27 0 if ($$token{'type'} eq 107) { }
588 1 157 if ($token_type == 107) { }
28 129 elsif ($token_type == 108) { }
29 100 elsif ($token_type == 187) { }
3 97 elsif ($token_type == 52 or $token_type == 16) { }
8 89 elsif ($ignore_reg_op{$token_type} or $token_type == 146) { }
592 27 1 if --$lpnum <= 0
595 3 26 if ($and_op_token) { }
613 0 0 if ($token_type == 106) { }
0 0 elsif ($token_type == 187) { }
0 0 elsif ($token_type == 52 or $token_type == 16) { }
0 0 elsif ($ignore_reg_op{$token_type} or $token_type == 146) { }
617 0 0 if ($and_op_token) { }
633 24 3 if (not @regexs_at_after_and_op) { }
643 16 8 if ($datam)
645 0 4 unless (eq_deeply($datam, $cap))
659 0 3 unless $captured_for_each_scope[$sub_depth]
660 3 0 if (%captured_this_scope)
669 0 3 unless $captured_for_each_scope[$sub_depth]
670 3 0 if (%captured_this_scope and $is_captured_at_before_and_op)
679 53 949 if ($token_type == 137)
680 36 17 if ($token_data =~ /\A\$[0-9]+\Z/)
685 10 7 if ($token_data eq '$+' or $token_data eq '$-')
687 0 10 unless $token = $$tokens[$i + 2]
689 6 4 if ($token_data =~ /\A -? [0-9]+ \Z/x) { }
690 3 3 if $token_data > 0
694 2 4 if (my $hit = $num_vars[$token_data])
706 71 878 if ($is_used_english)
707 7 64 if ($token_type == 194 or $token_type == 166)
709 6 0 if ($token_data eq '$LAST_PAREN_MATCH' or $token_data eq '$LAST_MATCH_END' or $token_data eq '$LAST_MATCH_START')
714 0 7 unless $token = $$tokens[$i + 2]
716 6 1 if ($token_data =~ /\A -? [0-9]+ \Z/x) { }
717 3 3 if $token_data > 0
721 2 4 if (my $hit = $num_vars[$token_data])
732 5 944 if ($token_type == 63)
740 50 894 if ($token_type == 109)
745 53 841 if ($token_type == 110)
747 5 48 if (delete $depth_for_each_subs{$lbnum_for_scope})
749 5 0 if ($token = $$tokens[$i - 2])
750 0 5 if ($$token{'type'} == 187) { }
5 0 elsif ($token = $$tokens[$i - 3]) { }
754 3 2 if ($$token{'type'} == 187)
761 5 0 if (defined $captured and my(%captured) = %{$captured;})
762 3 2 if ($regexp_in_return_ctx)
764 2 1 if (all sub { substr($_, 0, 1) eq '$'; } , keys %captured)
782 1 48 unless $captured_for_each_scope[-1]
8 41 if (%{{} unless $captured_for_each_scope[-1];})
798 21 5 defined $just_before_regex_token ? :
800 5 21 if (defined $captured and %$captured)
821 0 133 if ($escaped)
822 0 0 if ($re_char =~ /[0-9]/)
830 1 132 if ($re_char eq '\\')
835 0 132 if ($re_char eq '[')
840 0 132 if ($lbnum > 0)
841 0 0 if ($re_char eq ']')
849 31 101 if ($re_char eq '(')
852 1 30 if ($re_chars[$j + 1] eq '?') { }
30 0 elsif ($re_chars[$j + 1] ne '?' or $re_chars[$j + 2] ne ':') { }
855 0 1 if ($delimiter eq ':')
859 0 1 if ($delimiter eq 'P')
864 1 0 if ($delimiter eq '<' or $delimiter eq q['])
866 1 3 if ($delimiter eq '<' and $re_char eq '>' or $delimiter eq q['] and $re_char eq q['])
875 0 1 if ($reg_not_ctx) { }
891 0 30 if ($reg_not_ctx) { }
908 0 25 if ($assign_ctx ne 'NONE')
911 0 0 if ($assign_ctx eq 'UNLIMITED_ARRAY')
912 0 0 unless $captured
0 0 if (%{{} unless $captured;})
913 0 0 if (all sub { substr($_, 0, 1) eq '$'; } , keys %$captured)
922 0 0 unless my $maybe_reg_opt = $$tokens[$i + 2]
923 0 0 if ($$maybe_reg_opt{'type'} == 144)
924 0 0 if ($assign_ctx ne 'UNLIMITED' and $$maybe_reg_opt{'data'} =~ /g/)