Branch Coverage

lib/ChordPro/Output/ChordPro.pm
Criterion Covered Total %
branch 137 256 53.5


line true false branch
25 0 23 unless eval { do { $sb->{'songs'}[0]{'body'} } }
39 3 23 if (@book)
40 0 3 if $main::options->{'backend-option'}{'tidy'}
73 0 26 if ($s->{'preamble'})
78 26 0 if defined $s->{'meta'}{'title'}
79 6 20 if (defined $s->{'subtitle'})
83 26 0 if ($s->{'meta'})
84 0 26 if ($msp)
86 0 0 if defined $seq
91 32 150 if $k =~ /^(?:title|subtitle)$/u
92 11 139 if ($k =~ /$re_meta/u)
99 11 171 if $used{$k}
100 119 52 if $k =~ /^(?:title|subtitle|songindex|key_.*|chords|numchords)$/u
101 26 26 if $k =~ /^_/u
102 0 26 if $k =~ /\./u
103 26 0 if $k =~ /^bookmark/u
108 26 0 if ($s->{'settings'})
110 3 13 if ($_ eq 'diagrams') { }
1 12 elsif ($_ eq 'diagrampos') { }
111 1 2 if $s->{'settings'}{'diagrampos'}
113 0 2 if (is_ttrue($v)) { }
0 2 elsif (is_true($v)) { }
133 0 26 if $tidy
137 0 26 if (@{$s->{'body'};} and $s->{'body'}[-1]{'type'} eq "diagrams" and $s->{'body'}[-1]{'origin'} ne "__CLI__")
143 9 17 if ($s->{'define'})
147 0 9 if $tidy
150 0 26 if ($s->{'spreadimage'} and $variant eq "msp")
152 0 0 if ($a->{'delegate'} =~ /^abc$/iu and not $a->{'uri'})
165 30 280 if ($elt->{'context'} ne $ctx)
166 12 18 if $ctx
168 18 12 if ($ctx)
172 4 14 if ($elt->{'type'} eq "set")
173 2 2 if ($elt->{'name'} eq 'gridparams') { }
2 0 elsif ($elt->{'name'} eq 'label') { }
176 0 2 if $gridparams[2]
178 2 0 if $gridparams[1]
179 2 0 if $gridparams[3]
180 0 2 if ($gridparams[4])
182 0 0 if $tag ne ""
187 0 2 if ($variant eq 'msp') { }
189 0 0 if $tag ne ""
193 2 0 if $tag ne ""
201 0 18 if ($ctx =~ /^abc$/u) { }
0 18 elsif ($ctx =~ /^textblock$/u) { }
202 0 0 if ($elt->{'id'}) { }
219 61 249 if ($elt->{'type'} eq "empty")
220 0 61 if $structured
226 3 246 if ($elt->{'type'} eq "colb")
227 0 3 if $msp
232 3 243 if ($elt->{'type'} eq "newpage")
233 0 3 if $msp
238 119 124 if ($elt->{'type'} eq "songline")
243 24 100 if ($elt->{'type'} eq "tabline")
248 4 96 if ($elt->{'type'} eq "gridline")
253 0 96 if ($elt->{'type'} eq "verse")
254 0 0 if $tidy
256 0 0 if ($e->{'type'} eq "empty")
257 0 0 if $structured
260 0 0 if ($e->{'type'} eq "song")
265 0 0 if $tidy
269 0 96 if ($elt->{'type'} eq "chorus")
270 0 0 if $tidy
273 0 0 if ($e->{'type'} eq "empty")
277 0 0 if ($e->{'type'} eq "songline")
283 0 0 if $tidy
287 0 96 if ($elt->{'type'} eq "rechorus")
288 0 0 if ($msp) { }
0 0 elsif ($rechorus->{'quote'}) { }
0 0 elsif ($rechorus->{'type'} and $rechorus->{'tag'}) { }
303 0 96 if ($elt->{'type'} eq "tab")
304 0 0 if $tidy
308 0 0 if $tidy
312 25 71 if ($elt->{'type'} =~ /^comment(?:_italic|_box)?$/u)
314 10 15 $expand ? :
315 0 25 if ($msp)
316 0 0 $type eq 'comment_italic' ? :
0 0 $type eq 'comment' ? :
323 0 25 if ($elt->{'chords'})
327 0 0 if $elt->{'chords'}[$_] ne ""
331 0 25 if $msp
332 0 25 if $tidy
334 0 25 if $tidy
338 0 71 if ($elt->{'type'} eq "image" and not $msp)
340 0 0 if ($msp and not $uri =~ /^id=/u)
346 0 0 if is_arrayref($v)
350 0 0 unless /\s/u
357 2 69 if ($elt->{'type'} eq "diagrams")
363 30 41 if ($elt->{'type'} eq "set")
364 0 30 if ($elt->{'name'} eq 'lyrics-only') { }
0 30 elsif ($elt->{'name'} eq 'transpose') { }
0 30 elsif ($elt->{'name'} =~ /^(chordpro\..+)/u) { }
366 0 0 unless $lyrics_only > 1
385 0 41 if ($elt->{'type'} eq "control")
386 0 0 if ($elt->{'name'} =~ /^(\w+)-(size|color|font)/u)
388 0 0 unless $t =~ s/^\{\Kchorus/text/ru eq $s[-1]
393 39 2 if ($elt->{'type'} eq "ignore")
400 6 20 if $ctx
403 23 1 if ($s->{'chords'} and @{$s->{'chords'}{'chords'};} and $variant ne "msp")
405 4 67 unless $s->{'chordsinfo'}{$_}->parser->has_diagrams
406 19 48 unless $did++
416 0 0 if $url =~ /\.(\w+)$/u
422 0 0 unless (defined $data)
429 0 0 if ($info->{'error'})
454 40 79 if ($lyrics_only or not exists $elt->{'chords'})
470 40 4 if $line
471 10 34 if ($_->{'class'} eq 'chord') { }
479 0 4 if ($elt->{'comment'})
480 0 0 if $line
483 0 0 if ($t->{'chords'}) { }
499 60 176 unless length $c
503 176 0 if ($variant ne "msp")
506 2 174 if $c->info->is_annotation
512 69 27 $is_diag ? :
514 27 69 unless ($is_diag)
515 0 27 if ($info->{'copyall'}) { }
0 27 elsif ($info->{'copy'}) { }
522 25 2 unless defined $info->{$_}
526 18 9 unless defined $info->{$_}
533 0 96 if ($main::config->{'instrument'}{'type'} eq 'keyboard') { }
536 0 0 if $info->{'keys'} and @{$info->{'keys'};}
541 80 496 if ($_ < 0) { }
542 96 0 if $info->{'frets'}
544 0 36 if ($_ < 0) { }
545 6 90 if $info->{'fingers'} and @{$info->{'fingers'};}
547 27 69 unless ($is_diag)
549 24 3 unless defined $info->{$_}
551 0 3 if (is_true($v)) { }
552 0 0 if (is_ttrue($v))