Condition Coverage

blib/lib/Perl/Tidy/VerticalAligner.pm
Criterion Covered Total %
condition 522 692 75.4


and 2 conditions

line l !l condition
1545 14 1135 $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.42.0/B/Deparse.pm line 5762.

and 3 conditions

line !l l&&!r l&&r condition
292 3 654 0 not $rOpts->{'valign-exclusion-list'} and $rOpts->{'valign-inclusion-list'}
338 655 0 2 ($rOpts_tabs || $rOpts_entab_leading_whitespace) && $rOpts_indent_columns > 0
725 8287 173 50 $jmax == 1 && $rtokens->[0] eq '#' && $rfields->[0] =~ /^\s*$/
732 3534 4259 717 $jmax == 0 && substr($rfields->[0], 0, 1) eq '#'
776 16 110 31 $cached_seqno and $rvertical_tightness_flags->{'_vt_seqno'}
110 27 4 $cached_seqno and $rvertical_tightness_flags->{'_vt_seqno'} and $rvertical_tightness_flags->{'_vt_seqno'} == $cached_seqno
790 0 1 3 $line_count >= $min_lines and $line_count <= $max_lines
801 208 8 11 $cached_line_type == 3 and not $self->group_line_count
216 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
816 1590 3830 0 $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length
4651 603 2 $is_block_comment and not $rOpts_valign_block_comments
845 509 0 90 $is_block_comment and $outdent_long_lines
509 0 90 $is_block_comment and $outdent_long_lines and $leading_space_count == $self->[19]
863 8291 99 30 $break_alignment_before and @{$rgroup_lines;}
872 8404 3 13 $is_terminal_ternary and @{$rgroup_lines;}
893 8408 3 9 $rfields->[0] eq "else " and @{$rgroup_lines;}
8411 0 9 $rfields->[0] eq "else " and @{$rgroup_lines;} and $is_balanced_line
916 1 4832 41 $rOpts_valign_signed_numbers && $rpatterns->[0] eq 'n,'
919 41 4432 401 not $is_numeric and @{$rgroup_lines;}
4473 13 388 not $is_numeric and @{$rgroup_lines;} and not get_recoverable_spaces($rgroup_lines->[0]{'indentation'})
939 4247 31 596 $is_block_comment and $outdent_long_lines
4278 0 596 $is_block_comment and $outdent_long_lines and not @{$rgroup_lines;}
1522 1277 8 7 $ci_prev != $ci_new and $imax_align >= 0
1285 7 0 $ci_prev != $ci_new and $imax_align >= 0 and $ci_new == 0 || $group_line_count > 1
1873 1981 2 70 $saw_signed_number and $rOpts_valign_signed_numbers
2123 181 21 45 $side_comment and $prev_comment
2129 0 174 28 $rOpts_valign_signed_numbers && ($pat eq 'n,' || $pat eq 'n,b')
2186 0 0 2 $col_now and $pad > 0
0 1 1 $col_now and $pad > 0 and $pad <= $padding_available
2259 4 0 17 $line_m->{'list_type'} and $line->{'list_type'}
2268 45 2 0 $pat_m ne $pat and length $pat_m eq length $pat
2278 15 6 0 not $patterns_match and $lenmax > 2 * $lenmin
2387 98 78 273 $jend == $jbeg and $jend_m == $jbeg_m
176 12 261 $jend == $jbeg and $jend_m == $jbeg_m and $ng == 1 || $istop_mm < 0
12 9 252 $jend == $jbeg and $jend_m == $jbeg_m and $ng == 1 || $istop_mm < 0 and $ng == $ng_max || $istop < 0
9 1 251 $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'}
10 242 9 $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
2451 75 62 38 defined $ng_last and $ng_beg == $ng_last
137 0 38 defined $ng_last and $ng_beg == $ng_last and $i == $i_last
2544 71 22 0 defined $rmax_move->{$ng} and $move > $rmax_move->{$ng}
93 0 0 defined $rmax_move->{$ng} and $move > $rmax_move->{$ng} and not $is_good_alignment_token{$raw_tok}
2643 171 4 0 defined $blocking_level[$ng] && $lev > $blocking_level[$ng]
2661 139 7 29 $jmax == $jmax_m && $it_stop_m == $jmax_m - 2
2673 41 78 56 $top_level and $is_good_alignment_token{$raw_tok}
2680 3 61 55 defined $is_good_alignment_token{$raw_tok} and $lines_total > 2 || $group_list_type && $jmax < $jmax_m && $top_level
2706 56 90 0 ($lines_above == 1 || $lines_above == 2 && $lines_below >= 4) && $col_want > $col + $short_pad * $factor
2710 53 93 0 ($lines_below == 1 || $lines_below == 2 && $lines_above >= 4) && $col > $col_want + $short_pad * $factor
2792 0 0 543 defined $line_obj and defined $ridel
0 0 543 defined $line_obj and defined $ridel and @{$ridel;}
2864 540 2 1 defined $j_terminal_match and $jmin_del <= $j_terminal_match
3098 870 4596 637 not defined $i_eq and $raw_tok eq "="
3142 1194 304 39 $nr == 0 and $nl > 0
3163 1164 105 268 defined $i_eq_l and defined $i_eq_r
3169 0 5 263 $tok_eq_l eq $tok_eq_r and $i_eq_l == 0
5 0 263 $tok_eq_l eq $tok_eq_r and $i_eq_l == 0 and $i_eq_r == 0
5 262 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
3247 622 14 6 substr($tok, 0, 1) eq "{" and $tok =~ /^\{\d+if/
3271 693 963 130 $nlines > 2 && $imax > 1
3337 3808 37 42 $deleted_assignment_token and $lev > $group_level || !$is_if_or{$raw_tok}
3352 2576 1281 30 $jj == $jbeg and $has_terminal_match
3857 12 18 $jj == $jbeg and $has_terminal_match and $nlines == 2
3358 3001 46 840 $delete_me and $tok_count == 1
3366 215 75 15 defined $i_eq and $i < $i_eq
3374 668 36 136 $is_assignment{$raw_tok} and $lev == $group_level
3381 79 44 13 $imax > 0 and $i == $imax
3513 908 24 526 $list_type and $list_type eq $list_type_m
3787 591 454 90 $i > 0 and $lev < $last_lev
3819 246 311 146 $all_monotonic and $tok_end =~ /^,/
3821 97 49 93 $ii >= 0 and fat_comma_to_comma($rtokens->[$ii]) eq $tok_end
4043 108 67 77 $jl >= 0 and defined $match_tree[$depth]
175 0 77 $jl >= 0 and defined $match_tree[$depth] and @{$match_tree[$depth];}
67 6 71 $jl >= 0 and defined $match_tree[$depth] and @{$match_tree[$depth];} and defined $levels_current[$depth]
4066 70 55 0 $depth > 0 and $levels_next[$depth] <= $levels_next[$depth - 1]
4142 4 4 253 $def_current && $def_next
4148 23 0 23 $dep > 0 and defined $match_tree[$dep - 1]
4386 0 30 185 $raw_tok and $lev == $group_level
4395 210 4 1 $j == $jmax_1 - 2 && $raw_tok eq '=>' && $$rfield_lengths_0[$j + 1] <= 3
4405 62 0 92 $raw_tok eq "=" and $lev == $group_level
4415 57 1 157 $is_good_marginal_alignment{$raw_tok} and not $line_ending_fat_comma
4425 170 42 3 $pat_0 ne $pat_1 and length $pat_0 eq length $pat_1
4452 44 118 0 $is_marginal == 0 and $line_ending_fat_comma
4465 131 27 4 $is_marginal == 1 and $saw_good_alignment || $max_pad < 3
4502 130 11 1 ($raw_tokb eq '(' || $raw_tokb eq '{') && $jmax_1 == 2 && $sc_term0 ne $sc_term1
4557 0 0 0 $sc_term1 and $sc_term0
4581 0 0 5 $sc_term0 and $sc_term1
4587 5 1 15 $is_marginal and defined $jfirst_bad
6 15 0 $is_marginal and defined $jfirst_bad and $imax_align > $jfirst_bad - 1
4597 0 7 14 $imax_align < 0 and defined $j0_eq_pad
4599 14 0 0 $imax_next >= 0 || $imax_prev >= 0 || 0 and $j0_eq_pad >= -$j0_max_pad
14 0 0 $imax_next >= 0 || $imax_prev >= 0 || 0 and $j0_eq_pad >= -$j0_max_pad and $j0_eq_pad <= $j0_max_pad
4663 0 0 444 @{$rlines;} and @{$rgroups;}
4705 4 27 0 $ngroups > 1 and $spaces < 0
4787 105 5 18 $level < $last_sc_level and $is_closing_block_type{substr $rfields->[0], 0, 1}
4835 164 43 15 $self->[7] > 0 && $group_level == $self->[4]
4911 251 49 4 $PASS < $MAX_PASS and $is_hanging_side_comment
4935 213 14 73 $move >= 0 and $j_sc_beg == 0
227 68 5 $move >= 0 and $j_sc_beg == 0 and $continuing_sc_flow
4960 26 0 23 $col > $max_comment_column and $col < $column_limit
5058 30 0 0 not $signed and $unsigned
5096 20 7 18 $Nu > 0 and $Nu <= $rOpts_valign_signed_numbers_limit
5106 4 8 18 $Nu > 0 and $Nu <= $rOpts_valign_signed_numbers_limit
5237 4 6 0 $median_unsigned_length >= $median_signed_length and $bad_count > 1
10 0 0 $median_unsigned_length >= $median_signed_length and $bad_count > 1 and $immobile_count > 1
5286 0 12 22 $excess_space{$ix_min} > 0 and $ix_min != $ix_first
5287 0 17 17 $excess_space{$ix_max} > 0 and $ix_max != $ix_last
5404 0 104 20 $n_count and $n_count > 1
5410 31 73 0 $comma_count and $comma_count > 1
5417 0 0 104 $len_pat1 and $len_field
5443 18 0 38 $i_bracket >= 0 and $i_bracket < $i_opening
5449 56 0 0 $i_brace >= 0 and $i_brace < $i_opening
5453 0 0 56 $i_opening >= 0 and $i_opening < length($field) - 1
5479 0 26 8 $len_pat1 >= 2 and substr($pat1, -2, 2) eq "=b"
0 10 16 $len_pat1 >= 3 and substr($pat1, -3, 3) eq "=>b"
5628 2 0 0 $rcol_hash->{'signed_count'} and $rcol_hash->{'unsigned_count'}
5640 0 9 2 $jcol >= 0 and $column_info{$jcol}
5645 2 0 0 $col < $old_col and $rfields->[$jcol] =~ /^([+-]?)\d/
2 0 0 $col < $old_col and $rfields->[$jcol] =~ /^([+-]?)\d/ and $1 || $column_info{$jcol}{'signed_count'}
5677 149 581 55 defined $old_col and $old_col != $col
5681 10 0 1 $rcol_hash->{'signed_count'} and $rcol_hash->{'unsigned_count'}
5712 0 30 755 length $field > 0 && substr($rtokens->[$jcol], 0, 2) ne '=>'
5715 30 0 755 $field_ok and $pattern
5793 523 0 262 $field_ok &&= $is_signed_number || $is_unsigned_number
5816 34 0 0 $rcol_hash->{'signed_count'} and $rcol_hash->{'unsigned_count'}
5871 18 1 29 $rcol_hash->{'signed_count'} and $rcol_hash->{'unsigned_count'}
6119 37 96 14 defined $old_col and $old_col != $col
6143 50 43 54 length $token > 1 and substr($token, 0, 1) eq "="
93 4 50 length $token > 1 and substr($token, 0, 1) eq "=" and $is_digit_char{substr $token, 1, 1}
6151 0 0 50 $pos >= 0 and $pos <= 2
6330 5112 348 3289 $j == $maximum_field_index and !defined($rfields->[$j]) || $rfield_lengths->[$j] == 0
6349 5419 32 9 $rOpts_fixed_position_side_comment and $j == $maximum_field_index
6592 0 14 0 defined $open_or_close and $open_or_close == 1
6605 12 20 0 $gap >= 0 and $maximum_line_length != $cached_line_maximum_length || defined $level_end && $level > $level_end
6621 12 0 20 $gap >= 0 and defined $seqno_beg
6650 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
6704 16 13 4 $str =~ /^\);/ and $cached_line_text =~ /^[\)\}\]\s]*$/
6730 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
6738 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]
6748 0 0 3 length $ws == $diff and $ws =~ /^\s+$/
6947 152 11 0 $open_or_close == 3 and not $line =~ /\{\s*$/
158 5 0 $open_or_close == 4 and not $line =~ /\}\s*$/
7029 1 0 2 $valign_buffer_filling and $diff
7035 0 0 7 length $ws == $diff and $ws =~ /^\s+$/
7070 8059 396 2 $seqno_string and $valign_buffer_filling
7089 355 33 10 index($seqno_string, ":") != -1 and $seqno_string =~ /^\d+(\:+\d+)+$/
388 2 8 index($seqno_string, ":") != -1 and $seqno_string =~ /^\d+(\:+\d+)+$/ and not $args_to_D[0] =~ /^[\}\)\]\:\?]/
7181 0 0 0 $rOpts_tabs and $level
7239 8407 5 45 $require_tabs and $leading_space_count > 0

or 2 conditions

line l !l condition
793 0 3 $rvertical_tightness_flags->{'_vt_valid_flag'} ||= 1
3328 150 10 $delete_me ||= 1
3343 47 15 $delete_me ||= 1
4599 0 14 $imax_next >= 0 || $imax_prev >= 0 || 0

or 3 conditions

line l !l&&r !l&&!r condition
374 0 0 0 $error ||= @missing_keys
816 3090 0 5420 $level != $group_level or $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length
0 164 5256 $level != $group_level or $group_maximum_line_length and $maximum_line_length != $group_maximum_line_length or $is_outdented
164 2 5254 $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 $rOpts_valign_block_comments
4629 9 13 $is_block_comment || $rOpts_valign_side_comments || $rOpts_valign_code
2 13 5241 $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 $rOpts_valign_block_comments or not $is_block_comment || $rOpts_valign_side_comments || $rOpts_valign_code
926 337 15 36 $rgroup_lines->[0]{'jmax'} > 1 or $self->[17] > 3
954 76 14 4188 @{$rgroup_lines;} or $is_numeric
14 1 4187 @{$rgroup_lines;} or $is_numeric or get_recoverable_spaces($indentation)
984 91 3198 348 $jmax == 0 or $$rtokens[$jmax - 1] ne "#"
1045 46 98 3473 $level_end < $level or $is_closing_token{substr $rfields->[0], 0, 1}
1296 0 0 0 $jmax <= 0 or $tokens[0] eq "#"
1522 0 0 7 $ci_new == 0 || $group_line_count > 1
2132 174 1 27 not $is_numeric or $side_comment
2165 0 1 2 $fixit ||= $match_code
2170 0 1 1 $fixit ||= $nlines <= 1
2246 0 0 21 $imax_min >= @{$rfield_lengths;} or $imax_min >= @{$rfield_lengths_m;}
2387 176 85 12 $ng == 1 || $istop_mm < 0
173 79 9 $ng == $ng_max || $istop < 0
73 6 172 $imax != $imax_m || $istop_m != $imax_m
2405 4 17 5 $rtokens->[0] =~ /^=\d/ or $list_type
2531 0 12 128 not defined $ngb or $nge <= $ngb
2680 64 43 9 $lines_total > 2 || $group_list_type && $jmax < $jmax_m && $top_level
2706 0 0 146 $is_big_gap ||= ($lines_above == 1 || $lines_above == 2 && $lines_below >= 4) && $col_want > $col + $short_pad * $factor
2710 0 0 146 $is_big_gap ||= ($lines_below == 1 || $lines_below == 2 && $lines_above >= 4) && $col > $col_want + $short_pad * $factor
2722 5 7 163 $col_want > $col_max or $col > $col_limit
12 0 163 $col_want > $col_max or $col > $col_limit or $is_big_gap
7 0 163 $col_want > $col_max or $col > $col_limit or $is_big_gap or $is_blocked
2881 19 25 32 not $old_list_type or $old_list_type ne $new_list_type
3088 0 68 1941 $saw_side_comment ||= $length
3169 12 1 250 substr($pat_eq_l, 0, 1) ne substr($pat_eq_r, 0, 1) || $ci_jump
3247 17 36 606 substr($tok, 0, 1) eq "?" or substr($tok, 0, 1) eq "{" and $tok =~ /^\{\d+if/
3271 430 130 1656 $saw_large_group ||= $nlines > 2 && $imax > 1
3284 2111 937 839 defined $il || defined $ir
3293 1 20 28 $delete_me ||= !$align_ok
3304 15 93 24 $saw_dividing_token ||= $tok eq $dividing_token
3312 3 0 7 $nlines < 5 || !$saw_dividing_token
21 3 7 $delete_me ||= $nlines < 5 || !$saw_dividing_token
3337 24 38 17 $lev > $group_level || !$is_if_or{$raw_tok}
3392 778 0 3109 $delete_me ||= !$align_ok
3401 618 0 160 not defined $delete_above_level or $lev < $delete_above_level
3490 52 20 882 index($field, "-") != -1 or index($field, "+") != -1
4066 127 0 125 not defined $levels_next[$depth] or $depth > 0 and $levels_next[$depth] <= $levels_next[$depth - 1]
4141 257 4 152 $def_current or $def_next
4142 8 38 215 not $def_current && $def_next or $token_patterns_current[$dep] ne $token_patterns_next[$dep]
4180 37 3 15 not defined $np_now or $np != $np_now
4346 6 119 170 defined $line_1->{'j_terminal_match'} or $line_0->{'list_type'}
119 8 162 defined $line_1->{'j_terminal_match'} or $line_0->{'list_type'} or $line_1->{'is_hanging_side_comment'}
4388 4 18 163 $saw_if_or ||= $is_if_or{$raw_tok}
4465 21 4 6 $saw_good_alignment || $max_pad < 3
4475 0 0 162 $jmax_0 < 1 or $jmax_1 < 1
4486 19 104 39 $is_marginal or $sc_term0
4502 20 1 141 $is_marginal ||= ($raw_tokb eq '(' || $raw_tokb eq '{') && $jmax_1 == 2 && $sc_term0 ne $sc_term1
4551 0 0 0 $pat0 ne $pat1 || $line_ending_fat_comma
4639 0 0 0 $rpatterns_0->[0] =~ /,/ or $rpatterns_1->[0] =~ /,/
4708 13 0 18 $ng == 0 or $spaces < $extra_leading_spaces
4778 75 7 128 $line_diff > $short_diff or not $rOpts_valign_side_comments
4804 0 0 4 $cached_line_type == 2 or $cached_line_type == 4
5492 0 0 80 $pos_start_number <= 0 or $pos_start_number >= $len_field
5645 0 0 0 $1 || $column_info{$jcol}{'signed_count'}
5746 124 0 0 $field_ok ||= $pos_start_number
5793 47 215 0 $is_signed_number || $is_unsigned_number
5809 23 11 167 not $field_ok or $rcol_hash->{'pos_start_number'} ne $pos_start_number
34 0 167 not $field_ok or $rcol_hash->{'pos_start_number'} ne $pos_start_number or $rcol_hash->{'char_end_part1'} ne $char_end_part1
11 0 167 not $field_ok or $rcol_hash->{'pos_start_number'} ne $pos_start_number or $rcol_hash->{'char_end_part1'} ne $char_end_part1 or $rcol_hash->{'col'} ne $col
6170 0 0 38 not $len_equals_symbol or $rcol_hash->{'col'} ne $col
6330 0 3289 348 !defined($rfields->[$j]) || $rfield_lengths->[$j] == 0
6573 21 11 37 $cached_line_type == 1 or $cached_line_type == 3
6605 0 0 20 $maximum_line_length != $cached_line_maximum_length || defined $level_end && $level > $level_end
6650 0 27 1 $open_or_close == $cached_line_type || $cached_line_type == 2 && $open_or_close == 4 || !$open_or_close && $cached_line_type == 2
6947 0 0 163 $open_or_close == 3 and not $line =~ /\{\s*$/ or $open_or_close == 4 and not $line =~ /\}\s*$/
6957 8347 0 163 not $open_or_close or $side_comment_length > 0
8347 0 163 not $open_or_close or $side_comment_length > 0 or $is_outdented_line
0 0 163 not $open_or_close or $side_comment_length > 0 or $is_outdented_line or not $line_length

xor 4 conditions

line l&&r l&&!r !l&&r !l&&!r condition
5222 10 6 1 2 $excess_m xor $excess