Branch Coverage

blib/lib/Chemistry/OpenSMILES/Stereo.pm
Criterion Covered Total %
branch 70 144 48.6


line true false branch
42 1 2 if (ref $setting_sub eq "ARRAY")
49 0 0 unless exists $cis{$key}
52 0 0 unless ($cis{$key}{'atoms'} * set($_[0], $_[3]))->size == 1
53 0 0 $setting eq 'cis' ? :
59 3 0 unless $order_sub
66 2 1 unless @double_bonds
81 1 10 unless is_single_bond($graph, @$bond)
83 3 7 if ($incident_double_bonds{$bond->[0]})
87 1 9 if ($incident_double_bonds{$bond->[1]})
93 4 0 if $bond1 == $bond2
120 1 0 if %distinct_invariants_now <= %distinct_invariants
133 0 0 unless $invariants{join "", sort(@$b)} <=> $invariants{join "", sort(@$a)} or &min(map({&$order_sub($_);} @$a)) <=> &min(map({&$order_sub($_);} @$b))
148 0 1 unless $order_sub
152 0 1 if @neighbours2 < 2 or @neighbours3 < 2
167 0 1 if (@cistrans_bonds2 + @cistrans_bonds3 > 1)
174 0 0 if (@neighbours2 == 2 and not @cistrans_bonds2 and not &any(sub { is_single_bond($graph, $atom2, $_); } , @neighbours2) or @neighbours3 == 2 and not @cistrans_bonds3 and not &any(sub { is_single_bond($graph, $atom3, $_); } , @neighbours3))
189 0 1 if (@cistrans_bonds3 or not @cistrans_bonds2 and &$order_sub($atom2) > &$order_sub($atom3))
210 2 0 if ($setting)
217 0 1 unless ($bond_will_be_marked)
229 0 1 @cistrans_bonds2 ? :
230 1 0 unless (@cistrans_bonds2)
231 1 0 $first_atom->{'number'} < $atom2->{'number'} ? :
239 0 2 unless $setting
241 1 1 if $setting eq "cis"
242 0 2 if $atom1->{'number'} > $atom2->{'number'}
243 0 2 if $atom3->{'number'} > $atom4->{'number'}
245 1 1 unless $atom4_marked
249 1 1 if $atom1 eq $first_atom
252 0 1 unless $setting
254 1 0 if $setting eq "cis"
255 1 0 if $atom1->{'number'} > $atom2->{'number'}
256 0 1 if $atom3->{'number'} > $atom4->{'number'}
267 10 1 unless &is_chiral($atom)
269 0 1 unless exists $atom->{'chirality_neighbours'}
273 1 0 if (&is_chiral_tetrahedral($atom) or &is_chiral_planar($atom)) { }
0 0 elsif (&is_chiral_trigonal_bipyramidal($atom)) { }
0 0 elsif (&is_chiral_octahedral($atom)) { }
274 0 1 unless @chirality_neighbours >= 3 and @chirality_neighbours <= 4
278 0 0 unless @chirality_neighbours >= 4 and @chirality_neighbours <= 5
282 0 0 unless @chirality_neighbours >= 5 and @chirality_neighbours <= 6
287 0 1 if ($has_lone_pair)
293 1 0 if (&is_chiral_tetrahedral($atom)) { }
0 0 elsif (&is_chiral_planar($atom)) { }
0 0 elsif (&is_chiral_trigonal_bipyramidal($atom)) { }
295 1 0 if ($atom->{'chirality'} eq "\@")
305 2 2 if ($i % 2)
327 0 0 if ($atom->{'chirality'} eq '@SP2') { }
0 0 elsif ($atom->{'chirality'} eq '@SP3') { }
344 0 0 if $_ != $axis[0]
346 0 0 if $setting->{'order'} eq "\@\@"
367 0 0 if $_ != $axis[0]
370 0 0 if ($Chemistry::OpenSMILES::Stereo::OH[$chirality - 1]{'shape'} eq "Z")
374 0 0 if ($Chemistry::OpenSMILES::Stereo::OH[$chirality - 1]{'shape'} eq 4)
412 5 17 if is_double_bond($moiety, @$_) and not is_ring_bond($moiety, @$_)
423 0 2 if @atom2_neighbours < 2 or @atom2_neighbours > 3 or @atom3_neighbours < 2 or @atom3_neighbours > 3
430 1 1 unless $atom1 and $atom4
432 1 1 if $_ != $atom1
433 2 0 if $_ != $atom4
440 0 1 if $atom1->{'number'} > $atom2->{'number'}
441 0 1 if $atom3->{'number'} > $atom4->{'number'}
443 0 1 $is_cis ? :
445 1 0 if ($atom1_para)
446 0 1 $is_cis ? :
449 1 0 if ($atom4_para)
450 0 1 $is_cis ? :
453 1 0 if ($atom1_para and $atom4_para)
454 0 1 $is_cis ? :
461 21 5 unless is_cis_trans_bond($moiety, @$bond)
482 5 8 unless @$_ == 2
485 0 8 if ($color_sub) { }
488 4 4 if &any(sub { $moiety->degree($_) != 1; } , @$_)
491 4 0 if &uniq(@representations) == 1