Condition Coverage

lib/ChordPro/Song.pm
Criterion Covered Total %
condition 186 352 52.8


and 3 conditions

line !l l&&!r l&&r condition
143 91 0 79 not $main::options->{'nosongconfig'} and $diag->{'file'}
152 0 79 0 $meta and $meta->{'__config'}
185 0 0 0 @$c and $c->[0] eq "append"
310 1936 0 0 /\\\Z/ and @$lines
382 1 0 3 @$lines and $lines->[0] =~ /^# (.+)/
425 0 0 0 @$lines and $lines->[0] =~ /^# (.+)/
475 0 0 0 $self->{'body'} and @{$self->{'body'};}
0 0 0 $self->{'body'} and @{$self->{'body'};} and $self->{'body'}[-1]{'context'} eq $in_context
0 0 0 $self->{'body'} and @{$self->{'body'};} and $self->{'body'}[-1]{'context'} eq $in_context and $self->{'body'}[-1]{'open'}
516 297 0 495 /\S/ and not $fragment
297 495 0 /\S/ and not $fragment and not exists $self->{'title'}
587 3 0 2 $diagrams &&= $main::config->{'diagrams'}{'show'} || 'all'
593 56 114 0 $diagrams =~ /^(user|all)$/ and not "ChordPro::Chords::Parser"->get_parser($target, 1)->has_diagrams
602 0 0 0 $self->{'define'} and @{$self->{'define'};}
780 23 4 1008 $chord =~ s/^\[(.*)\]$/$1/ and $chord ne "^"
7 0 20 $memchords and $in_context
782 982 5 21 $memchords and not $dummy
798 16 3 1 $memcrdinx == 0 and @$memchords == 0
1109 48 0 2 $arg and $arg ne ""
1142 2 0 0 $in_context eq "chorus" and not $main::config->{'settings'}{'choruslabels'}
1177 1 29 0 @$chorus and $arg
30 0 0 @$chorus and $arg and $arg ne ""
1178 0 0 0 $chorus->[0]{'type'} eq "set" and $chorus->[0]{'name'} eq "label"
1245 14 110 0 exists $res{'text'} and $res{'text'} =~ /^[ \t]*$/
1256 8 0 1 $k =~ /^(title)$/i and $v ne ""
6 0 2 $k =~ /^(border|spread|center)$/i and $v =~ /^(\d+)$/
4 0 2 $k =~ /^(width|height)$/i and $v =~ /^(\d+(?:\.\d+)?\%?)$/
4 0 0 $k =~ /^(x|y)$/i and $v =~ /^([-+]?\d+(?:\.\d+)?\%?)$/
3 0 1 $k =~ /^(scale)$/ and $v =~ /^(\d+(?:\.\d+)?)(%)?$/
3 0 0 $k =~ /^(src|uri)$/i and $v ne ""
2 0 1 $k =~ /^(id)$/i and $v ne ""
2 0 0 $k =~ /^(anchor)$/i and $v =~ /^(paper|page|column|float|line)$/
1297 1 0 2 $uri and not $uri =~ m(^([a-z]:)?[/\\])i
1310 1 2 0 $uri and $id
1413 146 0 9 $key eq "duration" and $val
1418 0 0 16 $capo and $m->{'key'}
1443 0 171 0 $main::config->{'metadata'}{'strict'} and not &any(sub { $_ eq $key; } , @{$$main::config{"metadata"}{"keys"};})
1464 177 0 22 $dir eq "titles" and $arg =~ /^(left|right|center|centre)$/i
1471 158 0 19 $dir eq "columns" and $arg =~ /^(\d+)$/
1475 19 0 0 ref $main::config->{'settings'}{'columns'} eq "ARRAY" and $arg == @{$main::config->{'settings'}{'columns'};}
1548 13 2 0 $capo and $decapo
1562 0 98 0 not $main::options->{'reference'} and $d =~ /^([-+])([-\w.]+)$/i
1573 0 87 11 not $main::options->{'reference'} and $dir =~ /^\+([-\w.]+(?:\.[<>])?)$/
1594 0 11 0 ref $o eq "HASH" and ref $o->{$lk} eq "ARRAY"
1601 11 0 0 $lk =~ /^\d+$/ || $lk eq '>' || $lk eq '<' and ref $o eq "ARRAY"
1657 0 1 0 $main::config->{'settings'}{'strict'} and not $d =~ /^x_/
1673 2 0 0 $prop eq "font" and $old =~ /\s(\d+(?:\.\d+)?)$/
1715 25 10 0 $prop eq "font" and $value =~ /\s(\d+(?:\.\d+)?)$/
1764 149 0 2 $a eq "display" and @a
140 0 9 $a eq "format" and @a
0 0 13 $a eq "diagram" and @a > 0
1805 39 18 342 @a and $a[0] =~ /^(?:[0-9]+|[-xXN])$/
57 0 342 @a and $a[0] =~ /^(?:[0-9]+|[-xXN])$/ and @f < $strings
1823 8 8 96 @a and @f < $strings
1853 1 7 24 @a and $a[0] =~ /^[0-9]+$/
1867 13 0 0 $show and not is_true($a[0])
1956 0 6 2 defined $self->{'body'} and $self->{'body'}[-1]{'type'} eq "diagrams"
2040 1098 10 4 $capo and $decapo
2058 21 211 0 $info and $debug > 1
2062 21 0 227 $info && $info->is_xpxc
864 227 21 $def || $xp || $xc and not $info && $info->is_xpxc
2069 0 0 1112 $info and $info->is_xpxc
0 0 0 $def and not $xc || $xp
2079 956 0 156 $xp and $info
2094 227 0 0 $main::config->{'instrument'}{'type'} eq "keyboard" and my $k = ChordPro::Chords::get_keys($info)
2119 1092 0 20 $xc and $info
2123 20 0 0 $xcmov and not defined $key_ord
2190 195 0 56 $item->{'type'} eq "empty" and $item->{'context'} eq $def_context
2194 80 79 36 $item->{'type'} eq "songline" and $item->{'context'} eq ""

or 2 conditions

line l !l condition
224 0 0 $main::config->{'instrument'} //= "guitar"
233 0 0 $meta->{$_} //= []
395 0 1 $self->{'assets'} //= {}
431 0 0 $self->{'assets'} //= {}
487 0 0 $main::config->{'settings'}{'transpose'} // 0
580 2 428 $v->{'diagram'} // 1
587 1 1 $main::config->{'diagrams'}{'show'} || 'all'
623 0 170 $self->{'meta'}{'chords'} //= [@used_chords]
1122 22 0 $3 // 1
3 19 $1 // 0
3 19 $4 // 0
1123 0 22 $5 || ''
1126 0 22 $5 || ''
1152 3 4 $memchords{$in_context} //= []
1331 0 0 $self->{'assets'} //= {}
1417 16 0 $val || undef
1505 31 22 $propstack{'transpose'} //= []
1665 5 32 $propstack{$name} //= []
1896 684 156 $info->{$_} // ""
1947 61 9 $res->{'base'} ||= 1

or 3 conditions

line l !l&&r !l&&!r condition
280 2 168 0 $target //= $self->{'system'}
444 54 0 0 exists $self->{'title'} or $fragment
485 0 0 0 $xpose or $main::config->{'settings'}{'transpose'}
534 297 0 0 exists $self->{'title'} or $fragment
677 3 0 934 $orig =~ /^\*(.+)/ or $orig =~ /^(\||\s+)$/
713 4 2 1 $markup =~ s/\>\Q$c\E\%{formatted}\(\Q$c\E\)\(%{formatted})
731 6 6 922 $info->is_nc or $info->is_note
733 0 0 0 $info->is_rootless || $info->has_diagram || !$info->parser->has_diagrams
882 0 0 663 $_ eq "|:" or $_ eq "{"
0 0 663 $_ eq ":|" or $_ eq "}"
0 0 663 $_ eq ":|:" or $_ eq "}{"
927 0 0 2 $_ eq '.' || $_ eq ''
1057 4 7 0 $abbrevs{$1} // $1
1064 5 0 6 $sel eq lc $main::config->{'instrument'}{'type'} || ($sel eq lc $main::config->{'user'}{'name'} || $self->{'meta'}{lc $sel} && is_true($self->{'meta'}{lc $sel}[0]))
1077 161 834 0 $abbrevs{$dir} // $dir
1230 14 2 791 $dir eq "new_page" or $dir eq "new_physical_page"
1387 0 0 263 $key eq "user" or $key eq "instrument"
1483 1 1 156 $dir eq "pagetype" or $dir eq "pagesize"
1601 0 0 11 $lk =~ /^\d+$/ || $lk eq '>' || $lk eq '<'
1650 50 8 1 $dir eq "define" or $dir eq "chord"
1764 11 0 151 $a eq "copy" or $a eq "copyall"
1896 0 323 517 $res->{$_} //= $info->{$_} // ""
1902 0 16 16 $res->{$_} //= $info->{$_}
1910 0 11 59 $kv{'copyall'} // $kv{'copy'}
1915 0 44 0 $res->{$_} //= $orig->{$_}
1918 0 0 0 $res->{$_} //= $orig->{$_}
1950 0 70 0 $res->{'parser'} //= ChordPro::Chords::get_parser()
2062 228 20 864 $def || $xp || $xc
2069 0 0 0 $xc || $xp
1112 0 0 $info and $info->is_xpxc or $def and not $xc || $xp
2076 0 0 0 $xp or $xc
0 0 0 $xp or $xc or $main::config->{'debug'}{'chords'}
2081 118 37 1 $xpose_dir // $global_dir
2153 1112 0 0 $info or $def
2154 0 0 0 $main::config->{'debug'}{'chords'} or not $warned_chords{$chord}++