Branch Coverage

lib/Chemistry/OpenSMILES/Parser.yp
Criterion Covered Total %
branch 94 102 92.1


line true false branch
22 0 235 if ref $class
48 45 262 if (&is_aromatic($_[1]{'last'}) and &is_aromatic($_[2]))
69 57 5 if ($_[2] ne '-') { }
102 184 11 if ($_[1]{'last'}{'index'} != $_[3]{'first'}{'index'})
109 3 192 if (&is_aromatic($_[1]{'last'}) and &is_aromatic($_[3]{'first'}))
125 38 5 if ($_[1]{'last'}{'index'} != $_[4]{'first'}{'index'})
130 41 2 if ($_[3] ne '-') { }
174 0 10 if $self->{'USER'}{'FILEIN'}
176 1 9 if (${$self->{'TOKEN'};} eq "" and grep {$_ eq "(" if defined $_ and not ref $_;} map({$_->[1];} @{$$self{"STACK"};}))
177 2 5 if defined $_ and not ref $_
182 2 7 if (${$self->{'TOKEN'};} eq ")")
187 6 1 if ($self->YYData->{'INPUT'}) { }
201 0 229 if (not $self->YYData->{'INPUT'} and $self->{'USER'}{'FILEIN'})
207 0 1853 if ($self->YYData->{'INPUT'} =~ s/^(\s+)//)
212 2 1851 if (defined $self->{'USER'}{'OPTIONS'}{'max_hydrogen_count_digits'})
218 107 1746 if ($self->YYData->{'INPUT'} =~ s/^\[ (?[0-9]+)? (?[A-Za-z][a-z]?|\*) (?@( (TH|AL)[12] | SP [123] | (TB|OH)[0-9]{1,2} | \@? ))? (? $hcount_re)? (?--|\+\+|[-+][0-9]{0,2})? (:(?[0-9]+))? \]//x)
233 19 88 if ($atom->{'charge'})
239 17 90 if ($atom->{'hcount'}) { }
241 10 7 $atom->{'hcount'} ? :
246 6 101 if ($atom->{'isotope'})
251 0 107 exists $atom->{'class'} ? :
257 747 999 if ($self->YYData->{'INPUT'} =~ s/^(Br|Cl|[BCINOPSFbcnops*])//)
267 137 862 if ($self->YYData->{'INPUT'} =~ s/^%([0-9]{2})// or $self->YYData->{'INPUT'} =~ s/^([0-9])//)
274 634 228 if ($char ne "")
284 95 142 unless $options
296 2 224 if (scalar keys %{$$self{"USER"}{"RINGBONDS"};})
307 282 552 unless ($options->{'raw'})
309 221 61 unless (exists $atom->{'hcount'})
310 2 219 unless exists $Chemistry::OpenSMILES::Parser::normal_valence{$atom->{'symbol'}}
311 257 62 $_ ne ':' && exists $Chemistry::OpenSMILES::Parser::bond_symbol_to_order{$_} ? :
312 104 215 $graph->has_edge_attribute($atom, $_, 'bond') ? :
316 4 215 unless $degree
319 1 218 unless defined $valence
328 134 191 if ($atom->{'first_of_chain'}) { }
337 23 256 if (&is_chiral($atom))
338 1 22 if ($atom->{'chirality'} =~ /^\@\@?$/ and $graph->degree($atom) == 2)
348 2 5 if (&is_chiral($atom) and $atom->{'first_of_chain'} and $atom->{'chirality'} =~ /^\@\@?$/ and $atom->{'chirality_neighbours'} and scalar @{$atom->{'chirality_neighbours'};} == 3)
353 1 1 $atom->{'chirality'} eq '@' ? :
366 67 70 if ($self->{'USER'}{'RINGBONDS'}{$ring_bond}) { }
370 0 9 if ($bond and $self->{'USER'}{'RINGBONDS'}{$ring_bond}{'bond'} and !($bond =~ m[^[\\/]$]) && $bond ne $self->{'USER'}{'RINGBONDS'}{$ring_bond}{'bond'} || $bond eq '\\' && $self->{'USER'}{'RINGBONDS'}{$ring_bond}{'bond'} ne '/' || $bond eq '/' && $self->{'USER'}{'RINGBONDS'}{$ring_bond}{'bond'} ne '\\')
382 1 14 if ($bond and $bond =~ m[^[\\/]$] and not defined $self->{'USER'}{'RINGBONDS'}{$ring_bond}{'bond'})
390 9 42 if (not $bond and &is_aromatic($ring_atom) and &is_aromatic($atom))
393 21 45 if ($bond and $bond ne '-') { }
403 3 0 if (&is_chiral($ring_atom) and $ring_atom->{'chirality_neighbours'})
405 4 8 if not ref $ring_atom->{'chirality_neighbours'}[$_]
407 3 0 if defined $pos
411 14 56 $bond ? :
423 44 245 if $index1 == $index2
436 64 313 if ($attributes) { }
449 1143 160 unless &is_chiral($atom1)
456 369 3 unless &is_chiral($atom1)