Condition Coverage

blib/lib/Perl/Tidy/VerticalAligner.pm
Criterion Covered Total %
condition 423 544 77.7


and 2 conditions

line l !l condition
1420 13 981 $self->check_fit($new_line, $base_line) and Deparse error: Can't locate object method "object_2svref" via package "B::SPECIAL" at /usr/local/lib/perl5/5.26.1/B/Deparse.pm line 5018.

and 3 conditions

line !l l&&!r l&&r condition
234 3 557 0 not $rOpts->{'valign-exclusion-list'} and $rOpts->{'valign-inclusion-list'}
644 7179 157 48 $jmax == 1 && $rtokens->[0] eq '#' && $rfields->[0] =~ /^\s*$/
651 3010 3742 632 $jmax == 0 && substr($rfields->[0], 0, 1) eq '#'
695 20 173 31 $cached_seqno and $rvertical_tightness_flags->{'_vt_seqno'}
173 27 4 $cached_seqno and $rvertical_tightness_flags->{'_vt_seqno'} and $rvertical_tightness_flags->{'_vt_seqno'} == $cached_seqno
709 0 1 3 $line_count >= $min_lines and $line_count <= $max_lines
720 205 8 11 $cached_line_type == 3 and not $self->group_line_count
213 0 11 $cached_line_type == 3 and not $self->group_line_count and $cached_line_opening_flag < 2
8 11 0 $cached_line_type == 3 and not $self->group_line_count and $cached_line_opening_flag < 2 and not $is_balanced_line
735 1282 3433 0 $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length
4027 527 2 $is_block_comment and not $self->[10]
763 481 0 77 $is_block_comment and $outdent_long_lines
481 0 77 $is_block_comment and $outdent_long_lines and $leading_space_count == $self->[27]
780 7196 84 27 $break_alignment_before and @{$rgroup_lines;}
789 7291 3 13 $is_terminal_ternary and @{$rgroup_lines;}
803 7295 3 9 $rfields->[0] eq "else " and @{$rgroup_lines;}
7298 0 9 $rfields->[0] eq "else " and @{$rgroup_lines;} and $is_balanced_line
820 3933 14 338 @{$rgroup_lines;} and not get_recoverable_spaces($rgroup_lines->[0]{'indentation'})
838 3730 24 531 $is_block_comment and $outdent_long_lines
3754 0 531 $is_block_comment and $outdent_long_lines and not @{$rgroup_lines;}
1397 1087 7 7 $ci_prev != $ci_new and $imax_align >= 0
1094 7 0 $ci_prev != $ci_new and $imax_align >= 0 and $ci_new == 0 || $group_line_count > 1
1948 129 20 45 $side_comment and $prev_comment
2001 0 0 2 $col_now and $pad > 0
0 1 1 $col_now and $pad > 0 and $pad <= $padding_available
2070 2 0 16 $line_m->{'list_type'} and $line->{'list_type'}
2082 14 4 0 not $patterns_match and $lenmax > 2 * $lenmin
2180 76 70 233 $jend == $jbeg and $jend_m == $jbeg_m
146 8 225 $jend == $jbeg and $jend_m == $jbeg_m and $ng == 1 || $istop_mm < 0
8 5 220 $jend == $jbeg and $jend_m == $jbeg_m and $ng == 1 || $istop_mm < 0 and $ng == $ng_max || $istop < 0
5 1 219 $jend == $jbeg and $jend_m == $jbeg_m and $ng == 1 || $istop_mm < 0 and $ng == $ng_max || $istop < 0 and not $line->{'j_terminal_match'}
6 207 12 $jend == $jbeg and $jend_m == $jbeg_m and $ng == 1 || $istop_mm < 0 and $ng == $ng_max || $istop < 0 and not $line->{'j_terminal_match'} and $imax != $imax_m || $istop_m != $imax_m
2244 64 51 29 defined $ng_last and $ng_beg == $ng_last
115 0 29 defined $ng_last and $ng_beg == $ng_last and $i == $i_last
2321 56 21 0 defined $rmax_move->{$ng} and $move > $rmax_move->{$ng}
77 0 0 defined $rmax_move->{$ng} and $move > $rmax_move->{$ng} and not $is_good_alignment_token{$raw_tok}
2409 141 3 0 defined $blocking_level[$ng] && $lev > $blocking_level[$ng]
2427 114 4 26 $jmax == $jmax_m && $it_stop_m == $jmax_m - 2
2439 41 72 31 $top_level and $is_good_alignment_token{$raw_tok}
2446 3 55 55 defined $is_good_alignment_token{$raw_tok} and $lines_total > 2 || $group_list_type && $jmax < $jmax_m && $top_level
2472 44 74 0 ($lines_above == 1 || $lines_above == 2 && $lines_below >= 4) && $col_want > $col + $short_pad * $factor
2476 36 82 0 ($lines_below == 1 || $lines_below == 2 && $lines_above >= 4) && $col > $col_want + $short_pad * $factor
2541 0 0 469 defined $line_obj and defined $ridel
0 0 469 defined $line_obj and defined $ridel and @{$ridel;}
2614 466 2 1 defined $j_terminal_match and $jmin_del <= $j_terminal_match
2847 631 4023 520 not defined $i_eq and $raw_tok eq "="
2892 1032 247 36 $nr == 0 and $nl > 0
2913 1028 88 199 defined $i_eq_l and defined $i_eq_r
2919 0 5 194 $tok_eq_l eq $tok_eq_r and $i_eq_l == 0
5 0 194 $tok_eq_l eq $tok_eq_r and $i_eq_l == 0 and $i_eq_r == 0
5 193 1 $tok_eq_l eq $tok_eq_r and $i_eq_l == 0 and $i_eq_r == 0 and substr($pat_eq_l, 0, 1) ne substr($pat_eq_r, 0, 1) || $ci_jump
3000 534 9 4 substr($tok, 0, 1) eq "{" and $tok =~ /^\{\d+if/
3025 610 808 113 $nlines > 2 && $imax > 1
3090 3228 12 36 $deleted_assignment_token and $lev > $group_level || !$keep_after_deleted_assignment{$raw_tok}
3105 2147 1099 30 $jj == $jbeg and $has_terminal_match
3246 12 18 $jj == $jbeg and $has_terminal_match and $nlines == 2
3111 2511 44 721 $delete_me and $tok_count == 1
3119 207 41 14 defined $i_eq and $i < $i_eq
3127 582 33 106 $is_assignment{$raw_tok} and $lev == $group_level
3134 62 32 12 $imax > 0 and $i == $imax
3241 733 22 488 $list_type and $list_type eq $list_type_m
3482 527 414 81 $i > 0 and $lev < $last_lev
3514 236 249 142 $all_monotonic and $tok_end =~ /^,/
3516 97 45 93 $ii >= 0 and fat_comma_to_comma($rtokens->[$ii]) eq $tok_end
3730 93 66 75 $jl >= 0 and defined $match_tree[$depth]
159 0 75 $jl >= 0 and defined $match_tree[$depth] and @{$match_tree[$depth];}
66 6 69 $jl >= 0 and defined $match_tree[$depth] and @{$match_tree[$depth];} and defined $levels_current[$depth]
3753 64 50 0 $depth > 0 and $levels_next[$depth] <= $levels_next[$depth - 1]
3829 4 4 245 $def_current && $def_next
3835 23 0 23 $depth > 0 and defined $match_tree[$depth - 1]
4105 0 22 140 $raw_tok and $lev == $group_level
4114 157 4 1 $j == $jmax_1 - 2 && $raw_tok eq '=>' && $$rfield_lengths_0[$j + 1] <= 3
4124 51 0 73 $raw_tok eq "=" and $lev == $group_level
4134 33 1 128 $is_good_alignment{$raw_tok} and not $line_ending_fat_comma
4163 33 96 0 $is_marginal == 0 and $line_ending_fat_comma
4176 108 17 4 $is_marginal == 1 and $saw_good_alignment || $max_pad < 3
4213 102 9 1 ($raw_tokb eq '(' || $raw_tokb eq '{') && $jmax_1 == 2 && $sc_term0 ne $sc_term1
4268 0 0 0 $sc_term1 and $sc_term0
4292 0 0 4 $sc_term0 and $sc_term1
4298 4 1 13 $is_marginal and defined $jfirst_bad
5 13 0 $is_marginal and defined $jfirst_bad and $imax_align > $jfirst_bad - 1
4308 0 5 13 $imax_align < 0 and defined $j0_eq_pad
4310 13 0 0 $imax_next >= 0 || $imax_prev >= 0 || 0 and $j0_eq_pad >= -$j0_max_pad
13 0 0 $imax_next >= 0 || $imax_prev >= 0 || 0 and $j0_eq_pad >= -$j0_max_pad and $j0_eq_pad <= $j0_max_pad
4375 0 0 376 @{$rlines;} and @{$rgroups;}
4417 4 28 0 $ngroups > 1 and $spaces < 0
4491 99 5 18 $level < $last_sc_level and $is_closing_block_type{substr $rfields->[0], 0, 1}
4539 143 43 13 $self->[15] > 0 && $group_level == $self->[12]
4615 228 49 4 $PASS < $MAX_PASS and $is_hanging_side_comment
4639 192 14 71 $move >= 0 and $j_sc_beg == 0
206 68 3 $move >= 0 and $j_sc_beg == 0 and $continuing_sc_flow
4664 26 0 23 $col > $max_comment_column and $col < $column_limit
4767 4219 325 2741 $j == $maximum_field_index and !defined($rfields->[$j]) || $rfield_lengths->[$j] == 0
4786 4503 32 9 $self->[7] and $j == $maximum_field_index
5020 0 14 0 defined $open_or_close and $open_or_close == 1
5033 12 18 0 $gap >= 0 and $maximum_line_length != $cached_line_maximum_length || defined $level_end && $level > $level_end
5048 12 0 18 $gap >= 0 and defined $seqno_beg
5077 0 1 36 $seqno_beg and $open_or_close == $cached_line_type || $cached_line_type == 2 && $open_or_close == 4 || !$open_or_close && $cached_line_type == 2
1 3 33 $seqno_beg and $open_or_close == $cached_line_type || $cached_line_type == 2 && $open_or_close == 4 || !$open_or_close && $cached_line_type == 2 and $test_line_length <= $cached_line_maximum_length
5131 16 13 4 $str =~ /^\);/ and $cached_line_text =~ /^[\)\}\]\s]*$/
5157 0 0 4 $diff > 0 and length $seqno_string
0 1 3 $diff > 0 and length $seqno_string and length $last_nonblank_seqno_string == length $seqno_string
5165 0 0 3 @seqno_now and @seqno_last
0 0 3 @seqno_now and @seqno_last and $seqno_now[-1] == $seqno_last[0]
0 0 3 @seqno_now and @seqno_last and $seqno_now[-1] == $seqno_last[0] and $seqno_now[0] == $seqno_last[-1]
5175 0 0 3 length $ws == $diff and $ws =~ /^\s+$/
5356 148 11 0 $open_or_close == 3 and not $line =~ /\{\s*$/
154 5 0 $open_or_close == 4 and not $line =~ /\}\s*$/
5437 1 0 2 $valign_buffer_filling and $diff
5443 0 0 7 length $ws == $diff and $ws =~ /^\s+$/
5477 6939 392 2 $seqno_string and $valign_buffer_filling
5496 353 31 10 index($seqno_string, ":") >= 0 and $seqno_string =~ /^\d+(\:+\d+)+$/
384 2 8 index($seqno_string, ":") >= 0 and $seqno_string =~ /^\d+(\:+\d+)+$/ and not $args_to_D[0] =~ /^[\}\)\]\:\?]/

or 2 conditions

line l !l condition
712 0 3 $rvertical_tightness_flags->{'_vt_valid_flag'} ||= 1
3083 127 5 $delete_me ||= 1
3096 29 12 $delete_me ||= 1
4310 0 13 $imax_next >= 0 || $imax_prev >= 0 || 0

or 3 conditions

line l !l&&r !l&&!r condition
293 0 0 0 $error ||= @missing_keys
735 2669 0 4715 $level != $group_level or $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length
0 159 4556 $level != $group_level or $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length or $is_outdented
159 2 4554 $level != $group_level or $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length or $is_outdented or $is_block_comment and not $self->[10]
4005 9 13 $is_block_comment || $self->[11] || $self->[9]
2 13 4541 $level != $group_level or $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length or $is_outdented or $is_block_comment and not $self->[10] or not $is_block_comment || $self->[11] || $self->[9]
826 305 4 29 $rgroup_lines->[0]{'jmax'} > 1 or $self->[25] > 3
852 43 1 3710 @{$rgroup_lines;} or get_recoverable_spaces($indentation)
881 44 2697 325 $jmax == 0 or $$rtokens[$jmax - 1] ne "#"
942 40 79 2927 $level_end < $level or $is_closing_token{substr $rfields->[0], 0, 1}
1184 0 0 0 $jmax <= 0 or $tokens[0] eq "#"
1397 0 0 7 $ci_new == 0 || $group_line_count > 1
1980 0 1 2 $fixit ||= $match_code
1985 0 1 1 $fixit ||= $nlines <= 1
2057 0 0 18 $imax_min >= @{$rfield_lengths;} or $imax_min >= @{$rfield_lengths_m;}
2180 147 78 8 $ng == 1 || $istop_mm < 0
145 75 5 $ng == $ng_max || $istop < 0
66 7 146 $imax != $imax_m || $istop_m != $imax_m
2198 2 16 3 $rtokens->[0] =~ /^=\d/ or $list_type
2308 0 10 108 not defined $ngb or $nge <= $ngb
2446 59 43 8 $lines_total > 2 || $group_list_type && $jmax < $jmax_m && $top_level
2472 0 0 118 $is_big_gap ||= ($lines_above == 1 || $lines_above == 2 && $lines_below >= 4) && $col_want > $col + $short_pad * $factor
2476 0 0 118 $is_big_gap ||= ($lines_below == 1 || $lines_below == 2 && $lines_above >= 4) && $col > $col_want + $short_pad * $factor
2488 5 5 134 $col_want > $col_max or $col > $col_limit
10 0 134 $col_want > $col_max or $col > $col_limit or $is_big_gap
5 0 134 $col_want > $col_max or $col > $col_limit or $is_big_gap or $is_blocked
2631 19 25 32 not $old_list_type or $old_list_type ne $new_list_type
2837 0 64 1645 $saw_side_comment ||= $length
2919 11 1 182 substr($pat_eq_l, 0, 1) ne substr($pat_eq_r, 0, 1) || $ci_jump
3000 17 19 528 substr($tok, 0, 1) eq "?" or substr($tok, 0, 1) eq "{" and $tok =~ /^\{\d+if/
3025 367 113 1418 $saw_large_group ||= $nlines > 2 && $imax > 1
3038 1760 786 730 defined $il || defined $ir
3047 1 16 14 $delete_me ||= !$align_ok
3058 15 81 24 $saw_dividing_token ||= $tok eq $dividing_token
3066 3 0 7 $nlines < 5 || !$saw_dividing_token
17 3 7 $delete_me ||= $nlines < 5 || !$saw_dividing_token
3090 9 32 7 $lev > $group_level || !$keep_after_deleted_assignment{$raw_tok}
3145 661 0 2615 $delete_me ||= !$align_ok
3154 529 0 132 not defined $delete_above_level or $lev < $delete_above_level
3753 120 0 114 not defined $levels_next[$depth] or $depth > 0 and $levels_next[$depth] <= $levels_next[$depth - 1]
3828 249 4 148 $def_current or $def_next
3829 8 38 207 not $def_current && $def_next or $token_patterns_current[$depth] ne $token_patterns_next[$depth]
3867 32 3 15 not defined $np_now or $np != $np_now
4065 6 113 137 defined $line_1->{'j_terminal_match'} or $line_0->{'list_type'}
113 8 129 defined $line_1->{'j_terminal_match'} or $line_0->{'list_type'} or $line_1->{'is_hanging_side_comment'}
4107 1 8 131 $saw_if_or ||= $is_if_or{$raw_tok}
4176 13 4 4 $saw_good_alignment || $max_pad < 3
4186 0 0 129 $jmax_0 < 1 or $jmax_1 < 1
4197 16 83 30 $is_marginal or $sc_term0
4213 17 1 111 $is_marginal ||= ($raw_tokb eq '(' || $raw_tokb eq '{') && $jmax_1 == 2 && $sc_term0 ne $sc_term1
4262 0 0 0 $pat0 ne $pat1 || $line_ending_fat_comma
4350 0 0 0 $rpatterns_0->[0] =~ /,/ or $rpatterns_1->[0] =~ /,/
4420 13 0 19 $ng == 0 or $spaces < $extra_leading_spaces
4482 60 7 122 $line_diff > $short_diff or not $self->[11]
4508 0 0 4 $cached_line_type == 2 or $cached_line_type == 4
4767 0 2741 325 !defined($rfields->[$j]) || $rfield_lengths->[$j] == 0
5001 19 11 37 $cached_line_type == 1 or $cached_line_type == 3
5033 0 0 18 $maximum_line_length != $cached_line_maximum_length || defined $level_end && $level > $level_end
5077 0 27 1 $open_or_close == $cached_line_type || $cached_line_type == 2 && $open_or_close == 4 || !$open_or_close && $cached_line_type == 2
5356 0 0 159 $open_or_close == 3 and not $line =~ /\{\s*$/ or $open_or_close == 4 and not $line =~ /\}\s*$/
5366 7225 0 159 not $open_or_close or $side_comment_length > 0
7225 0 159 not $open_or_close or $side_comment_length > 0 or $is_outdented_line
0 0 159 not $open_or_close or $side_comment_length > 0 or $is_outdented_line or not $line_length
5559 0 45 4281 $rOpts_tabs || $rOpts_entab_leading_whitespace
4281 0 45 not $rOpts_tabs || $rOpts_entab_leading_whitespace or $rOpts_indent_columns <= 0