Branch Coverage

blib/lib/ChordPro/A2Crd.pm
Criterion Covered Total %
branch 153 266 57.5


line true false branch
99 0 19 if $opts
107 19 0 @ARGV ? :
0 19 $opts->{'lines'} ? :
118 0 31 unless $line
120 0 31 unless $tabstop > 0
123 0 31 if @l == 1
137 31 726 if (/\t/u)
155 754 3 if ($n_ch_chords < 1) { }
169 143 611 if $line =~ /^\s*$/u
170 10 601 if $line =~ /^\{.+/u
171 1 600 unless (defined $classify)
174 0 1 unless ($classify)
189 0 0 $len / length($line) - 1 < 1 ? :
191 0 0 if ($type eq "l")
193 0 0 if (length $_ > 0)
194 0 0 unless (ChordPro::Chords::parse_chord($_))
214 15 875 if ($word =~ m[^(.*)/(.*)]u) { }
221 10 880 if ($bass)
234 842 48 unless $chord =~ s/($roots)//u
240 3 45 if ($chord =~ s/^([b#]|flat|sharp)//u)
244 0 48 if ($chord =~ s/^(minor|major)//u)
248 0 48 if ($chord =~ s/^(min|maj)//u)
252 9 39 if ($chord =~ s/^(m|dim|0|o|aug|\+)//u)
266 9 39 if $n_ok == length $chord
295 38 0 if ($any_chord_ok or generic_parse_chord($cname))
312 32 0 if ($any_chord_ok or generic_parse_chord($1))
328 384 0 if ($any_chord_ok or generic_parse_chord($1))
337 402 385 if ($is_fingering)
338 201 201 unless $return_chordpro_fingering
355 1213 146 if ($fret =~ /[0-9]/u)
356 304 909 if $min_fret > $fret
357 325 888 if $max_fret < $fret
365 49 178 if $bf > 0
370 1213 146 if ($fret =~ /[0-9]/u) { }
405 6 595 if $line =~ /^\s*\[.+?\]/u
406 3 592 if $line =~ /^\s*\#.+?/u
407 2 590 if $lc_line =~ /(from|email|e\-mail)\:?.+?\@+/u
408 2 588 if $lc_line =~ /(from|email|e\-mail)\:.+?/u
409 2 586 if $lc_line =~ /(date|subject)\:.+?/u
412 201 385 if decode_fingering($line, 0)
438 55 0 if $longest_tablature_string < length $1
441 55 330 if $longest_tablature_string > 8
464 271 2829 if $longest_strumming_string < length $1
467 0 330 if $longest_strumming_string >= 6
479 8 322 if $n_dash == $n_nonblank_chars or $n_equal == $n_nonblank_chars
480 104 218 if ($n_period + $n_dash + $n_bar + $n_c_accent + $n_v + $n_digit) / $n_nonblank_chars > "0.8"
481 2 216 if ($n_bar + $n_slash + $n_underscore) / $n_nonblank_chars >= "0.5"
490 1083 74 if (length $_ > 0)
494 193 890 ChordPro::Chords::parse_chord($_) ? :
495 890 193 unless ($is_chord)
496 9 881 if (generic_parse_chord($_))
497 0 9 if $local_debug
502 202 881 if $is_chord
503 0 1083 if $local_debug
508 0 216 if $local_debug
510 0 216 if $n_words == 0
512 63 153 $n_chords / $n_words > 0.4 ? :
514 153 63 if ($type eq "l")
534 0 69 if $line eq ""
549 0 19 if $local_debug
550 0 19 if $local_debug
553 0 13 if $local_debug
556 7 6 $1 eq 'C' ? :
557 7 6 $1 eq 'C' ? :
561 0 19 if $local_debug
563 18 1 if ($infer_titles and $map =~ s/^l//u)
565 8 10 if ($map =~ s/^l//u)
570 0 19 if $local_debug
574 0 331 if $local_debug
584 0 331 if $local_debug
586 5 326 if $1 eq "c" and $2 eq "l"
587 4 322 if $2 eq "t"
589 6 316 if ($1 eq 'c' || $1 eq 'l' and $3 eq "t")
596 59 257 if ($1 eq 'l' or $1 eq 'C') { }
191 66 elsif ($1 eq 'f') { }
8 58 elsif ($1 eq '{') { }
608 1 7 if ($line =~ /{sot}/u)
612 0 8 unless $line
615 1 7 if $line =~ /{eot}/u
626 0 19 if $local_debug
630 0 187 if $local_debug
632 0 187 if $local_debug
635 10 177 if ($map =~ s/^f//u)
643 78 99 if ($map =~ s/^_//u)
650 4 95 if ($map =~ s/^C//u)
660 17 78 if ($map =~ s/^[cl]t/t/u)
661 17 0 unless ($in_tablature)
669 12 143 unless ($in_tablature)
677 29 66 if ($in_tablature)
679 9 20 if ($map =~ s/^[cl](_|$)//u)
691 0 66 if ($map =~ s/^_l/l/u)
697 39 27 if ($map =~ s/^cl//u) { }
0 27 elsif ($map =~ s/^__l//u) { }
0 27 elsif ($map =~ s/^_l//u) { }
1 26 elsif ($map =~ s/^{//u) { }
22 4 elsif ($map =~ s/^l//u) { }
4 0 elsif ($map =~ s/^c//u) { }
0 0 elsif ($map =~ s/^_//u) { }
718 0 1 if ($line =~ /{sot}/u)
722 0 0 unless $line
725 0 0 if $line =~ /{eot}/u
752 19 0 wantarray ? :
825 0 0 if (defined $appname) { }
834 0 0 if (-d "/etc")
840 0 0 if ($ENV{'HOME'} and -d $ENV{'HOME'})
841 0 0 if (-d 'File::Spec'->catfile($ENV{'HOME'}, '.config')) { }
852 0 0 if -s $e and -r _
854 0 0 if (-s ".$app_lc.json") { }
884 0 0 unless (&GetOptions($clo, "output|o=s", "config|cfg=s\@", "noconfig|no-config", "sysconfig=s", "nosysconfig|no-sysconfig", "userconfig=s", "nouserconfig|no-userconfig", "nodefaultconfigs|no-default-configs|X", "define=s%", "print-default-config", \$defcfg, "print-final-config", \$fincfg, "version|V", \$version, "ident", \$ident, "help|h|?", \$help, "manual", \$manual, "verbose|v+", "trace", "debug+"))
926 0 0 if $ident or $help or $manual
927 0 0 if ($manual or $help)
928 0 0 if $help
929 0 0 if $manual
931 0 0 if $version
937 0 0 if (defined $_)
938 0 0 unless -r $_
942 0 0 if $clo->{'nodefaultconfigs'}
943 0 0 unless $configs{$config}
945 0 0 unless -r $_
950 0 0 if (defined $_)
953 0 0 unless (-r $c or $c =~ m[[/.]]u)
956 0 0 unless -r $c
961 0 0 if $clo->{'nodefaultconfigs'}
962 0 0 unless $configs{$config}
964 0 0 unless -r $_->[0]
969 0 0 unless $clo->{$config}
981 0 0 if ($defcfg or $fincfg)
982 0 0 if $defcfg
984 0 0 if $fincfg
995 0 0 $my_package ? :
1000 0 0 if defined $exit
1006 0 0 unless $cmd =~ m[(?:^|\/|\\)a2crd(?:\.\w+)$]u
1018 0 0 if defined $exit