Branch Coverage

blib/lib/Chemistry/File/SMILES.pm
Criterion Covered Total %
branch 94 112 83.9


line true false branch
159 54 57 unless defined $line
164 0 57 unless ($Smiles_parser->parse($smiles, $mol, \%opts))
170 56 1 if ($opts{'kekulize'})
276 58 480 if ($all eq '(') { }
58 422 elsif ($all eq ')') { }
409 13 elsif ($sym) { }
13 0 elsif ($sym2) { }
287 3 10 if ($hcnt eq 'H') { }
292 13 0 unless ($chg =~ /\d/)
293 1 12 $chg =~ /-/ ? :
304 0 64 if ($@)
305 0 0 if $$opts{'fatal'}
325 358 64 if ($$self{'stack'}[-1])
329 28 28 if ($$self{'digits'}{$$dig{'dig'}}) { }
330 0 0 if ($$dig{'bnd'} and $$self{'digits'}{$$dig{'dig'}}{'bnd'} and $$dig{'bnd'} ne $$self{'digits'}{$$dig{'dig'}}{'bnd'})
367 0 378 if $iso
368 0 378 if $iso
369 0 378 if $chir
370 9 369 if defined $hcount
371 1 377 if $chg
372 71 307 if ($sym =~ /^[a-z]/)
394 8 333 unless my $order = $type_to_order{$type}
418 70 299 if ($atom->attr('smiles/aromatic') and $atom->symbol =~ /^[CN]$/)
421 1 368 if $h_count < 0
432 1 406 if $h_count < 0
440 369 9 unless (defined $atom->hydrogens)
454 1 58 if ($opts{'mols'}) { }
468 62 0 if (@atoms)
470 1 61 if ($opts{'auto_number'})
474 15 47 if ($opts{'unique'})
475 15 0 unless ($atoms[0]->attr('canon/class'))
485 61 1 if ($opts{'aromatic'})
493 344 70 if $$visited{$atom}
505 8 54 if ($opts{'name'})
520 368 368 if $$visited{$bond}
522 24 344 if ($$visited{$nei}) { }
539 24 390 if ($$digits{$atom})
545 24 0 $_ < 10 ? :
554 344 392 if $$visited{$bond}
555 24 368 if ($$visited{$nei})
558 24 0 $digit < 10 ? :
567 392 344 if $$visited{$bond}
569 344 0 unless ($$visited{$nei})
571 54 290 if ($prev_branch)
584 24 2 unless ($$digits{'used_digits'}[$i])
595 190 638 if ($$opts{'unique'})
609 70 368 unless $bond
610 95 273 if $$opts{'aromatic'} and $bond->aromatic
618 95 319 if $$opts{'aromatic'} and $atom->aromatic
622 8 399 if (not $ORGANIC_ELEMS{$atom->symbol} or $atom->formal_charge or $atom->total_hydrogens != $self->calc_implicit_hydrogens_2($atom) or $$opts{'number'} and defined $atom->name)
632 0 15 if ($charge and abs $charge > 1) { }
1 14 elsif ($charge) { }
635 1 0 $charge > 0 ? :
638 2 6 $h_count > 1 ? :
8 7 $h_count ? :
640 8 7 if $$opts{'number'} and defined $atom->name