Branch Coverage

blib/lib/SQL/Abstract/Tree.pm
Criterion Covered Total %
branch 132 146 90.4


line true false branch
183 7 16 ref $_[0] eq 'HASH' ? :
185 2 21 if (my $p = delete $args->{'profile'})
187 1 1 if ($p eq 'console') { }
0 1 elsif ($p eq 'console_monochrome') { }
1 0 elsif ($p eq 'html') { }
0 0 elsif ($p eq 'none') { }
197 0 1 !eval { do { require Term::ANSIColor } } ? :
281 1 1 if (scalar grep({exists $args->{$_};} keys %extra_args)) { }
320 0 4477 unless defined $s
325 80104 24111 if defined $token and length $token and $token =~ /\S/
343 3945 4090 if (not @$tokens or $state == 2 and $tokens->[0] eq ')' or $state == 1 and $tokens->[0] =~ /$expr_term_re/x or $state == 4 and $tokens->[0] =~ /$rhs_term_re/x or $state == 5 and $tokens->[0] eq ',' || $tokens->[0] =~ /$expr_term_re/x)
359 7028 65580 if ($token eq '(') { }
3513 62067 elsif ($token =~ /$and_or_re/x) { }
4013 58054 elsif ($token eq ',') { }
9075 48979 elsif ($token =~ /$binary_op_re/x) { }
83 48896 elsif ($token =~ /$unary_op_re/x) { }
16190 32706 elsif ($token =~ /$expr_start_re/x) { }
2177 30529 elsif ($token =~ /$placeholder_re/x) { }
379 30150 elsif (@$tokens and $tokens->[0] eq '(' || $tokens->[0] =~ /$placeholder_re/x) { }
361 0 7028 unless $token = shift @$tokens
362 0 7028 unless $token eq ')'
375 420 3093 @right && $op eq $right[0][0] ? :
386 29 3984 unless @right
388 0 4013 if @right > 1
390 9 4004 if (not @left) { }
3286 718 elsif ($left[0][0] eq '-LIST') { }
395 0 3286 @{$right[0];} && $right[0][0] eq '-LIST' ? :
412 0 9075 if ($op eq 'BETWEEN' and $right[0] eq '-LITERAL')
417 9071 4 @left ? :
425 5 78 if $op =~ /^$rno_re$/
457 147 30003 if @left == 1
459 22779 7371 unless ($state == 4)
471 376 29774 if @lits > 1
478 11251 61357 if (@left > 1)
481 33 22374 if ($left[$i][0] =~ /$compressable_node_re/x and $left[$i + 1][0] =~ /$compressable_node_re/) { }
483 33 33 $_->[0] eq '-MISC' ? :
492 9484 63124 if $state == 4
495 53056 10068 if (@$tokens)
497 176 52880 if ($tokens->[0] =~ /$asc_desc_re/x)
507 10 686 if (my $around = $self->colormap->{lc $keyword})
525 11 686 if (defined $self->indentmap->{lc $keyword})
528 150 547 if $depth == 0 and defined $starters{lc $keyword}
538 1478 7 if defined $tree
544 9 61 if ($self->fill_in_placeholders)
550 0 9 if $quoted
559 2603 2 unless $bindargs
565 17 13947 unless ($tree and @$tree)
574 0 11445 unless (defined $op and ref $op || defined $args)
581 2502 11445 if (ref $op) { }
8108 3337 elsif ($op eq '-LITERAL') { }
68 3269 elsif ($op eq '-PLACEHOLDER') { }
1485 1784 elsif ($op eq '-PAREN') { }
908 876 elsif ($op eq 'AND' or $op eq 'OR' or $op =~ /$binary_op_re/) { }
37 839 elsif ($op eq '-LIST') { }
132 707 elsif ($op eq '-MISC') { }
18 689 elsif ($op =~ qr/^-(ASC|DESC)$/) { }
592 0 1485 $self->_is_key($args) ? :
619 63 626 ref $args eq 'ARRAY' && @{$args;} == 1 && $args->[0][0] eq '-PAREN' ? :
683 6 length $rhs ? :
645 2938 58130 unless ref $ast and ref $ast->[1]
655 73170 6229 if (not ref $child && @$child or $child->[0] ne '-PAREN')
670 5593 636 @{$child->[1];} == 1 ? :
672 5593 636 $single_child_op ? :
674 4009 2220 ($child_op_argc || !1) && ref $child->[1][0][1][0] eq 'ARRAY' ? :
682 1456 4773 if ($parent_op =~ /$unrollable_ops_re/xi and $single_child_op ne 'SELECT') { }
131 4642 elsif ($single_child_op eq $parent_op and $parent_op eq 'AND' || $parent_op eq 'OR') { }
5 4637 elsif ($single_child_op eq '-LITERAL' || $single_child_op eq '-PLACEHOLDER' and $parent_op eq 'AND' || $parent_op eq 'OR' || $parent_op eq 'NOT') { }
1715 2922 elsif ($parent_op eq 'AND' || $parent_op eq 'OR' and $single_child_op =~ /$binary_op_re/x and $single_child_op ne 'BETWEEN' and $child_op_argc == 2 and not $single_child_op =~ /$alphanum_cmp_op_re/x && $parent_op =~ /$alphanum_cmp_op_re/x) { }
9 2913 elsif ($single_child_op and $parent_op =~ /$alphanum_cmp_op_re/x and not $single_child_op =~ /$alphanum_cmp_op_re/ and $child_op_argc == 1 and $single_grandchild_op eq '-PAREN' || $single_grandchild_op eq '-LITERAL' || $single_grandchild_op eq '-PLACEHOLDER') { }
5 2908 elsif ($parent_op ne 'ROW_NUMBER() OVER' and $single_child_op and $single_child_op ne 'NOT' and $child_op_argc == 1 and $single_grandchild_op eq '-PAREN') { }
793 47975 139 if ref $ast ne 'ARRAY' or $ast->[0] ne 'ORDER BY'
802 8 131 if (@{$ast->[1];} == 1 and $ast->[1][0][0] eq '-ASC') { }
72 59 elsif (@{$ast->[1];} == 1 and $ast->[1][0][0] eq '-LIST') { }