Branch Coverage

blib/lib/Bio/NEXUS.pm
Criterion Covered Total %
branch 117 172 68.0


line true false branch
101 69 14 if ($filename)
134 0 69 unless (-e $filename)
167 18 69 if (lc $$args{'format'} eq 'string') { }
198 10 91674 if $text_char eq '"'
200 212 91472 if ($text_char eq q['] and $quote_level == 0 and $comment_level == 0 and $found_nexus_token) { }
4856 86616 elsif ($quote_level > 0) { }
5434 81182 elsif ($text_char eq '[' || $comment_level > 0 and $in_tree_string == 0) { }
526 80656 elsif (not $found_nexus_token) { }
2392 78264 elsif ($command eq '') { }
78264 0 elsif (not $command =~ /;$/) { }
214 212 4644 if ($text_char eq q['])
215 0 212 $prev_text_char eq $text_char ? :
229 161 5273 if $text_char eq '['
232 161 5273 if ($text_char eq ']')
237 34 127 if ($comment_level == 0 and @command_level_strings == 0)
250 86 440 if ($command =~ /^\s*#NEXUS/i) { }
1 439 elsif (not $command =~ /^\s*(?:#(?:N(?:E(?:X(?:U(?:S)?)?)?)?)?)?$/i) { }
264 25 2367 if ($comment)
268 1050 1342 if ($text_char ne "\n")
276 88 78176 if ($in_tree_string == 0 and $block_type eq 'trees' || $block_type eq 'history' and $text_char eq '=') { }
280 76 12 if $command =~ /tree\s.+=/i
282 1050 77126 if $text_char eq ';'
289 1050 90633 if (not $comment_level || $quote_level and $text_char eq ';')
292 231 819 if ($command =~ /begin\s+(.+)\s*;/i) { }
231 588 elsif ($command =~ /^\s*end(?:block)?\s*;/i) { }
588 0 elsif ($command =~ s/\s*;\s*$//) { }
297 0 231 if ($comment)
309 1 230 if ($comment)
331 10 578 if ($comment)
342 6 71 unless ($self->get_block('taxa'))
385 224 8 if (defined $class)
388 139 92 if (defined $self->get_block('taxa'))
391 223 8 if ($class) { }
399 6 216 if ($block_type =~ /taxa/i and my $title = $block->get_title)
426 90 132 unless $taxablock
432 112 20 if (lc $block_type eq 'characters' or lc $block_type eq 'trees') { }
1 19 elsif (lc $block_type eq 'sets') { }
438 372 0 if grep {$label eq $_;} @taxlabels
451 8 0 if grep {$element eq $_;} @taxlabels
543 0 0 if (_is_comment($block_or_comment))
612 0 5 if _is_comment($item)
613 2 3 if ($item->get_type =~ /$blocktype/i)
616 2 0 if (not $title or $item->get_title =~ /$title/i)
635 0 2 if (not $found_block)
637 0 0 if ($title)
658 602 0 if ($block->get_type =~ /$blocktype/i)
659 597 5 if (not $blockname) { }
5 0 elsif ($block->get_title =~ /$blockname/i) { }
688 1768 356 unless (_is_comment($item))
689 1037 731 if (not $blocktype or $item->get_type =~ /$blocktype/i)
728 0 0 if (lc $block->get_link('characters') eq lc $characters)
764 5 0 if (my $taxablock = $self->get_block('taxa'))
767 0 0 if (my $charblock = $self->get_block('characters'))
770 0 0 if (my $treesblock = $self->get_block('trees'))
793 6 0 if ($block->can('rename_otus'))
815 0 9 unless (defined $original_otu_name and defined $copy_otu_name)
819 1 8 if ($original_otu_name eq $copy_otu_name)
823 1 7 if (grep {$_ eq $copy_otu_name;} @{$self->get_taxlabels;})
834 7 17 if ($otu eq $original_otu_name)
840 7 0 if ($contains_otu eq 'true') { }
909 2 0 if ($block->can('select_otus'))
932 1 3 if $otu eq $name and $exclude = 1
934 3 1 unless $exclude
968 0 0 unless (defined $nodename)
981 0 0 if ($block->can('select_otus'))
1001 0 0 unless (defined $nodename)
1013 0 0 if ($block->can('select_otus'))
1051 0 0 if (not $block->get_charlabels or @{$block->get_charlabels;} == 0)
1055 0 0 if ($block)
1103 0 0 if (defined $treename) { }
1126 0 1 if (@blocks1 != @blocks2)
1139 0 0 unless ($blocks1[$i] or $blocks2[$i])
1140 0 3 unless ($blocks1[$i]->equals($blocks2[$i]))
1164 1 1 if (ref $filename eq 'GLOB') { }
0 1 elsif ($filename eq '-' or $filename eq \*STDOUT) { }
1171 0 1 unless open $fh, ">$filename"
1180 2 2 if (_is_comment($blocks_and_comments[$i])) { }
1198 0 6 if (_is_comment($block_or_comment))
1203 2 4 if (lc $type eq 'taxa')
1209 2 0 unless $fh == \*STDOUT
1224 7 2 if (not defined $self->get_block('taxa'))
1227 7 0 if ($block_type eq 'characters' or $block_type eq 'trees')
1229 1 6 unless (defined $taxlabels and @$taxlabels)
1230 1 0 if ($block_type eq 'trees') { }
1250 0 0 if $Bio::NEXUS::AUTOLOAD =~ /DESTROY$/
1259 0 0 if (defined $synonym_for{$Bio::NEXUS::AUTOLOAD}) { }