Branch Coverage

lib/ChordPro/Chords/Parser.pm
Criterion Covered Total %
branch 154 246 62.6


line true false branch
67 0 2 unless $main::config
72 0 2 unless $cfg->{'notes'}
74 0 2 unless $system
77 0 2 if ($system eq "nashville")
80 0 2 if ($system eq "roman")
133 256 293 if $parsers{$system}
135 2 291 if ($system eq 'nashville') { }
2 289 elsif ($system eq 'roman') { }
0 289 elsif ($system ne $main::config->{'notes'}{'system'}) { }
289 0 elsif ($system) { }
0 0 elsif ($nofallback) { }
171 210 0 unless @which
203 0 0 $cfg->{'settings'}{'chordnames'} eq 'relaxed' ? :
0 291 if $main::options->{'verbose'} > 1
214 149 63646 if ($chord =~ m[^(.*)/($self->{'n_pat'})$]u)
222 0 63795 if ($chord eq '' and $bass ne '') { }
39844 23951 elsif ($chord =~ /^$self->{'c_pat'}$/u) { }
22 23929 elsif ($self->{'c_rpat'} and $main::config->{'settings'}{'chordnames'} eq 'relaxed' and $chord =~ /^$self->{'c_rpat'}$/u) { }
6 23923 elsif ($main::config->{'settings'}{'notenames'} and ucfirst($chord) =~ /^$self->{'n_pat'}$/u) { }
234 0 22 unless $info->{'root'} = $plus{'root'}
251 9865 30007 if $q eq "m" or $q eq "min"
252 2023 37849 if $q eq "aug"
253 4097 35775 if $q eq "dim"
254 41 39831 if $q eq "o"
258 19749 20123 unless ($info->{'qual'})
259 48 19701 if ($x eq "maj")
264 2075 37797 if $x eq "sus"
270 6 40015 if $info->{'isnote'}
271 29204 10817 if (defined $self->{'ns_tbl'}{$r}) { }
10817 0 elsif (defined $self->{'nf_tbl'}{$r}) { }
273 18811 10393 defined $self->{'nf_tbl'}{$r} ? :
288 39872 0 unless $info->is_rootless
290 0 39872 unless ref($info) =~ /ChordPro::Chord::/u
293 149 39723 if ($info->{'bass'} = $bass)
294 149 0 if ($bass =~ /^$self->{'n_pat'}$/u)
296 0 149 if ($info->is_rootless)
304 0 39872 if ($main::config->{'settings'}{'chords-canonical'})
308 0 0 if $info->{'name_canon'} ne $t and $main::config->{'debug'}{'chords'}
449 0 291 unless $n->{'system'}
454 1440 2052 if (UNIVERSAL::isa($root, 'ARRAY')) { }
466 1449 2043 if (UNIVERSAL::isa($root, 'ARRAY')) { }
484 1746 5176 if $ns_tbl{$_}
524 666 216 $sharp ? :
547 0 2 if $main::options->{'verbose'} and $main::options->{'verbose'} > 1
557 0 408 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Nashville")
563 0 408 if ($chord =~ m[^(.*)/(.*)]u)
568 0 408 unless $chord =~ /^$n_pat(?-|\+|0|o|aug|m(?!aj)|dim)?(?.*)$/u
579 0 408 if $q eq "m"
580 0 408 if $q eq "aug"
581 0 408 if $q eq "dim"
582 0 408 if $q eq "o"
587 0 408 if $x eq "sus"
594 120 288 if ($+{'shift'} eq '#') { }
120 168 elsif ($+{'shift'} eq 'b') { }
598 0 120 if $$info{"${pfx}_ord"} >= 12
604 0 120 if $$info{"${pfx}_ord"} < 0
615 408 0 unless $bass
616 0 0 unless $bass =~ /^$n_pat$/u
625 0 12 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Nashville")
628 12 0 $sharp ? :
635 0 2 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Nashville")
641 0 2 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Nashville")
659 0 2 if $main::options->{'verbose'} and $main::options->{'verbose'} > 1
668 0 612 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Roman")
674 0 612 if ($chord =~ m[^(.*)/(.*)]u)
679 0 612 unless $chord =~ /^$r_pat(?\+|0|o|aug|dim|h)?(?.*)$/u
690 306 306 if $r eq lc $r
691 0 612 if $q eq "aug"
692 0 612 if $q eq "dim"
693 0 612 if $q eq "o"
698 0 612 if $x eq "sus"
699 0 612 if $x eq "7+"
706 180 432 if ($+{'shift'} eq '#') { }
180 252 elsif ($+{'shift'} eq 'b') { }
710 0 180 if $$info{"${pfx}_ord"} >= 12
716 180 0 if $$info{"${pfx}_ord"} < 0
727 612 0 unless $bass
728 0 0 unless $bass =~ /^$r_pat$/u
737 0 12 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Roman")
739 0 12 if $minor
741 12 0 $sharp ? :
748 0 2 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Roman")
754 0 2 unless UNIVERSAL::isa($_[0], "ChordPro::Chords::Parser::Roman")
771 0 376 unless UNIVERSAL::isa($_[0], "ChordPro::Chord::Base")
783 0 942 if $self->is_keyboard and not @{$self->kbkeys // [1];}
785 162 780 unless @{$self->frets // [];}
787 766 855 unless $_ < 0
794 8 1331 unless defined $_[0]{'root'} or defined $_[0]{'bass'}
801 0 814 $main::config->{'instrument'}{'type'} eq 'keyboard' ? :
814 0 6442 if $self->{'parens'} and $self->{'name'} =~ /^\(.*\)$/u
815 6442 0 if $np or not $self->{'parens'}
837 1 0 if $_[0]{'keys'} and @{$_[0]{'keys'};}
852 1578 810 unless $fmt
853 10 800 if $self->is_note
859 22 774 $main::config->{'settings'}{'truesf'} ? :
864 87 17658 if ($k eq 'orig' or $k eq 'xc' or $k eq 'xp') { }
879 0 22 unless $main::config->{'settings'}{'truesf'}
883 15 7 if @c % 2
887 15 22 if ($did) { }
903 0 0 unless defined $self->{$_}
904 0 0 if defined $c->{$_}
905 0 0 if (UNIVERSAL::can($self->{$_}, 'simplify')) { }
0 0 elsif (ref $self->{$_} eq 'ARRAY' and @{$self->{$_};}) { }
944 515 0 $self->is_chord ? :
0 515 $self->is_rootless ? :
946 4 511 if ($self->is_note)
949 3 508 if ($self->{'bass'} and $self->{'bass'} ne "")
951 0 3 $self->{'system'} eq 'roman' ? :
958 6 38548 if $self->is_rootless or $self->is_note
968 12 370 unless $xpose
969 2 368 unless $self->is_chord
975 368 0 unless ($self->{'rootless'})
982 3 0 if ($self->{'bass'} and $self->{'bass'} ne "" and not $self->{'bass'} =~ /^\d+$/u)
997 123 20 unless $xcode
998 0 20 unless $self->is_chord
999 0 20 if $self->{'system'} eq $xcode
1004 0 20 unless $p->{'system'} eq $xcode
1006 4 16 if $key_ord and $p->movable
1012 0 20 if ($p->{'system'} eq "roman" and $info->{'qual_canon'} eq "-")
1016 0 20 if ($self->{'bass'} and $self->{'bass'} ne "")
1017 0 0 if $key_ord and $p->movable
1051 0 0 if ($self->{'bass'} and $self->{'bass'} ne "")
1078 0 0 if ($self->{'bass'} and $self->{'bass'} ne "")