Branch Coverage

lib/ChordPro/Chords.pm
Criterion Covered Total %
branch 82 170 48.2


line true false branch
34 0 208 unless @tuning
58 7 0 if @_
63 7 0 if $a0 != $b0
64 0 0 if $arest =~ /^m(?:in)?(?!aj)/u
65 0 0 if $brest =~ /^m(?:in)?(?!aj)/u
72 0 0 unless $a0 <=> $b0
80 0 0 if ($hdr)
98 0 0 if (eval { do { $chord->{'name'} } }) { }
0 0 elsif ($origin eq 'chord') { }
108 0 0 unless $info
116 0 0 if ($_ < 0) { }
117 0 0 $origin eq 'chord' ? :
0 0 @{$info->{'frets'} // [];} ? :
121 0 0 if ($_ < 0) { }
123 0 0 if $info->{'fingers'} and @{$info->{'fingers'};}
127 0 0 if $info->{'keys'} and @{$info->{'keys'};}
139 0 0 $mode && $mode == 2 ? :
162 0 0 if $maxl < $t
168 0 0 if (eval { do { $chord->{'name'} } }) { }
174 0 0 unless $info
180 0 0 if (@{$info->{'frets'};})
185 0 0 if ($info->{'fingers'} and @{$info->{'fingers'};})
190 0 0 if ($info->{'keys'} and @{$info->{'keys'};})
201 0 0 if ($main::config->{'pdf'}{'diagrams'}{'vcells'})
224 0 208 unless ref $t eq "ARRAY"
227 118 90 if (@tuning) { }
230 0 118 if ($t1 ne $t2)
232 0 0 if $main::options->{'verbose'} > 1
247 0 1248 unless /(^.*?)(\d+)$/u
250 0 1248 unless defined $n
269 7 0 unless ref $p and $p->isa("ChordPro::Chords::Parser")
273 0 7 if $main::options->{'verbose'} > 1
294 208 0 unless ref $p and $p->isa("ChordPro::Chords::Parser")
301 0 208 unless @parsers
309 1173 1252 if (ref($name) =~ /^ChordPro::Chord::/u)
314 1833 592 if $ret
315 297 295 unless $info
319 18 277 unless $name
321 9 268 if ($ret)
328 18 99 unless defined $info->{$_}
339 0 49892 if ($frets and @$frets and @$frets != strings())
342 0 31054 if ($fingers and @$fingers and @$fingers != strings())
345 0 49895 unless ($base > 0 and $base < 24)
348 12 49883 if ($keys and @$keys)
350 0 39 unless /^\d+$/u and $_ < 24
371 0 49832 if ($def->{'name'} =~ /.\|./u)
374 1 49831 if (UNIVERSAL::isa($def->{'name'}, 'ARRAY')) { }
383 30940 18892 if ($def->{'copy'} or $def->{'copyall'})
385 0 30940 if ($def->{'copyall'})
386 0 0 if $src
391 0 30940 unless $res
392 30940 0 if ($def->{'copy'}) { }
408 0 49832 if $res
411 0 49832 if ($def->{'display'})
413 0 0 if ($dpinfo) { }
421 0 49833 if $name =~ /^(\||\s*)$/u
425 19873 18445 if ($info->is_chord and $def->{'copy'} and $def->is_chord)
436 0 49833 unless $parser->{'target'}
444 0 298998 if ($_ eq 'x') { }
447 49833 0 $frets && @$frets ? :
0 49833 $fingers && @$fingers ? :
0 49833 $keys && @$keys ? :
453 38318 11515 if ($info->is_chord) { }
459 0 11515 if ($i and $i->is_chord)
466 38318 11515 if ($info->is_chord)
478 0 63 if $ii->name =~ /^(\||\s*)$/u
481 0 63 if $res
495 61 2 unless defined $c->{$_}
498 102 87 unless $c->{$_} and @{$c->{$_};}
528 0 0 if %song_chords
586 0 538 if $info->{'keys'} and @{$info->{'keys'};}
590 514 24 if (defined $info->{'qual_canon'} and defined $info->{'ext_canon'} and defined $keys{$info->{'qual_canon'} . $info->{'ext_canon'}}) { }
598 2 22 unless $info->{'frets'} and @{$info->{'frets'};}
606 0 22 if $base < 0
609 84 48 if $_ < 0
611 18 30 if ($info->{'root_ord'})
612 0 18 if $c < $info->{'root_ord'}
620 10 526 if (defined $info->{'bass'} and $info->{'bass'} ne "")
625 4 6 if $bass < 0
627 10 21 if $_ == $bass
628 11 10 $_ < $bass ? :
641 0 123 unless $xpose or $xcode
642 0 123 if $c =~ /^ .+/u
644 0 123 unless ($info)
653 0 0 $xpose ? :