Branch Coverage

blib/lib/Music/AtonalUtil.pm
Criterion Covered Total %
branch 189 318 59.4


line true false branch
505 2 6 if $note_count < @$check_set
508 0 8 if @$check_set > @$melody
514 1 18 if $flag_sort
515 4 15 if (join($", @$sel_audit) eq join($", @$check_set))
519 2 13 if ($note_count > @$check_set)
521 0 7 if $i + $count - 1 > $#$melody
528 0 64 if $flag_sort
529 2 62 if (join($", @$sel_audit) eq join($", @$check_set))
546 6 0 ref $_[0] eq 'ARRAY' ? :
550 0 6 if @nset < 2
557 6 0 if (@nset > 2)
567 0 6 wantarray ? :
578 3 9 if $bs & 1 << $p
589 7 0 ref $_[0] eq 'ARRAY' ? :
600 1 6 if (exists $params->{'dup_interval_limit'})
602 1 0 if ($icount >= $params->{'dup_interval_limit'})
603 1 0 wantarray ? :
609 3 3 unless $params->{'exclude_interval'}
612 0 3 if not exists $ruleset->{'iset'} or ref $ruleset->{'iset'} ne 'ARRAY'
613 0 3 if @{$ruleset->{'iset'};} > @intervals
622 1 2 $ruleset->{'sort'} ? :
624 3 0 if ($ret != 1)
625 3 0 wantarray ? :
635 1 3 unless $params->{$ps_rule}
638 0 3 if not exists $ruleset->{'ps'} or ref $ruleset->{'ps'} ne 'ARRAY'
646 2 1 unless $ruleset->{'subsets'}
648 0 2 if $ss_mag >= @{$ruleset->{'ps'};}
651 2 0 if $in_ss < @{$ruleset->{'ps'};}
655 1 1 if $in_ss > @$melody
661 0 3 if $seen_s_pset{join $", @$s_prime}++
665 1 2 if ($ret != 1)
666 1 0 wantarray ? :
675 2 0 if ($ret != 1)
676 2 0 wantarray ? :
683 0 0 if ($rules_applied == 0)
684 0 0 wantarray ? :
686 0 0 wantarray ? :
691 460 0 ref $_[0] eq 'ARRAY' ? :
692 0 460 unless @$pset
705 1 0 ref $_[0] eq 'ARRAY' ? :
732 0 0 unless (keys %params)
769 0 0 if ($base_pitch == $p)
778 0 0 if $choice < $melody_low
779 0 0 if $choice > $melody_high
783 0 0 if ($melody_low < 0)
789 0 0 if $got_melody != 1
794 0 0 if $@
795 0 0 unless $got_melody
804 4 2 ref $_[0] eq 'ARRAY' ? :
806 0 6 unless @$pset
812 0 6 if (keys %origmap == 1)
813 0 0 wantarray ? :
833 10 8 if ($span < $min_span) { }
0 8 elsif ($span == $min_span) { }
841 6 0 if (@min_span_idx == 1) { }
849 0 6 unless (@normal)
858 5 1 if ($normal[0] != 0)
869 0 6 wantarray ? :
874 6 0 ref $_[0] eq 'ARRAY' ? :
878 0 6 if @nset < 2
896 0 6 wantarray ? :
902 2 0 ref $_[0] eq 'ARRAY' ? :
903 0 2 unless @$iset
918 1 0 ref $_[0] eq 'ARRAY' ? :
919 0 1 unless @$pset
934 243 0 ref $_[0] eq 'ARRAY' ? :
935 0 243 unless @$pset
952 0 3 if not defined $pset or ref $pset ne 'ARRAY'
956 0 3 unless @$pset
959 0 3 unless &looks_like_number($n)
962 1 2 if $len > $n
971 0 7 unless &looks_like_number($from)
972 0 7 unless &looks_like_number($to)
977 3 4 if ($from > $to)
982 4 3 if ($interval > $self->{'_DEG_IN_SCALE'} / 2)
994 1 0 ref $_[0] eq 'ARRAY' ? :
995 0 1 unless @$pset
1032 0 1 unless &looks_like_number($i)
1050 0 5 if ($self->{'_DEG_IN_SCALE'} < 2)
1054 1 4 if (exists $param{'lastn'}) { }
1056 0 1 unless &looks_like_number($param{'lastn'})
1071 458 1 ref $_[0] eq 'ARRAY' ? :
1073 0 459 unless @$pset
1079 0 459 if (keys %origmap == 1)
1080 0 0 wantarray ? :
1086 459 0 if ($self->{'_packing'} eq 'right') { }
0 0 elsif ($self->{'_packing'} eq 'left') { }
1112 1049 2378 if ($span < $min_span) { }
516 1862 elsif ($span == $min_span) { }
1120 434 315 if (@min_span_idx == 1) { }
1128 25 434 unless (@normal)
1136 5 454 wantarray ? :
1144 2 0 ref $_[0] eq 'ARRAY' ? :
1146 0 2 unless @$pset
1157 5 0 ref $_[0] eq 'ARRAY' ? :
1159 0 5 unless @$pset
1166 1 0 ref $_[0] eq 'ARRAY' ? :
1168 0 1 if @$pset < 2
1180 0 3 unless defined $_[0]
1183 1 2 if (ref $_[0] eq 'ARRAY') { }
1 1 elsif ($_[0] =~ /,/) { }
1200 11 45 $pitch > int $self->{'_DEG_IN_SCALE'} / 2 ? :
1208 227 0 ref $_[0] eq 'ARRAY' ? :
1210 0 227 unless @$pset
1216 231 223 if $set->[0] != 0
1221 84 143 if (join($", @{$forms[0];}) eq join($", @{$forms[1];})) { }
1231 136 213 if ($sums[0] < $sums[1]) { }
7 206 elsif ($sums[0] > $sums[1]) { }
1249 0 21 unless &looks_like_number($v)
1250 0 21 if not &looks_like_number($min) && &looks_like_number($max) or $min >= $max
1254 4 17 if $v <= $max and $v >= $min
1257 5 12 if ($v > $max) { }
1268 9 8 if ($register % 2 == 1)
1279 1 0 ref $_[0] eq 'ARRAY' ? :
1281 0 1 unless @$pset
1289 6 0 ref $_[0] eq 'ARRAY' ? :
1291 0 6 unless defined $r and $r =~ /^-?\d+$/
1294 0 6 unless @$pset
1297 1 5 if ($r == 0) { }
1315 2 0 ref $_[0] eq 'ARRAY' ? :
1317 0 2 unless defined $what
1318 0 2 unless @$pset
1323 1 1 if $dir < 0
1326 3 2 unless $pset->[$i] eq $what
1336 2 4 if (defined $dis)
1337 0 2 if not defined $dis && $dis =~ /^\d+$/ or $dis < 2
1348 1 0 ref $_[0] eq 'ARRAY' ? :
1350 0 1 unless @$pset
1358 11 121 if ($j == 0) { }
1372 2 0 ref $_[0] eq 'ARRAY' ? :
1376 10 0 !$seen{$p}++ ? :
1377 0 2 if @nset < 2
1379 2 0 if (defined $len) { }
1380 0 2 if $len >= @nset or $len == 0
1383 0 2 if ($len < 0)
1385 0 0 if $len < 1
1396 1 0 ref $_[0] eq 'ARRAY' ? :
1398 0 1 unless @$pset
1408 16 32 if exists $seen{$p}
1416 1 0 ref $_[0] eq 'ARRAY' ? :
1418 0 1 unless @$pset
1428 12 32 if exists $seen{$p}
1437 243 0 ref $_[0] eq 'ARRAY' ? :
1439 0 243 unless defined $t
1440 0 243 unless @tset
1453 14 0 ref $_[0] eq 'ARRAY' ? :
1455 0 14 unless defined $t
1456 0 14 unless @$pset
1471 0 1 unless ref $pset1 eq 'ARRAY'
1472 0 1 unless @$pset1
1473 0 1 unless ref $pset2 eq 'ARRAY'
1474 0 1 unless @$pset2
1482 2 4 $count{$p} > 1 ? :
1484 0 1 wantarray ? :
1490 0 2 unless ref $pset1 eq 'ARRAY'
1491 0 2 unless @$pset1
1492 0 2 unless ref $pset2 eq 'ARRAY'
1493 0 2 unless @$pset2
1499 1 1 join($", @{$ic_vecs[0];}) eq join($", @{$ic_vecs[1];}) ? :