Conversation
Each of these tests the same operand twice in one condition or if/else chain, so a sibling operand is never tested and part of the check is dead. Behaviour fixes: * CartesianBondedEnergy: the torsion ring-atom test checked atids[2] twice and never atids[4], so 4-atom ring torsions were not always handed off to cart_bonded_ring. * chemical/rna/util: in the SUGAR/SUGAR CIS base-pair table the guanine row was labelled `aa1 == na_rad`, which the adenine row above already matches. All four guanine branches were unreachable. They push " H22", an atom only RGU has (RAD has " H2 "), and na_rgu was the one row missing from the otherwise complete 4x4 table. * DisulfideOptimizationMover: the "both residues are disulfide bonded" check tested cys_pos[1] twice, so cys_pos[2] was never validated. * DofUnlock: the environment-id half of the passport check compared pass_out to itself instead of to pass_, so a mismatched environment id was never caught. * RotamerRecovery: runtime_assert compared pose_rots.size() to itself instead of to nat_rots.size(). * FloppyTailMover: flexible_chain appeared twice in the list of options that conflict with an explicit movemap, so flexible_start_resnum was never rejected. The error message had the same duplication. Behaviour-preserving removals of dead duplicate conditions: * cryst/wallpaper: "C211" listed twice among the tetragonal groups. * CDRSeqDesignOptions: "DISALLOWED" listed twice. * SecretionPredictionFilter, SecretionOptimizationMover: the dG_ins threshold comparison repeated in the same && chain. Found with a new redundant-expression / branch-clone analysis pass over utility/, basic/, core/, protocols/ and numeric/; utility/, basic/ and numeric/ had no true positives.
xyzStripeHashPoseWithMeta::init_with_pose tested PoseCoordPickMode_BB twice in the same if/else chain, so the second branch could never run. Its body collects CA, C and CB, which matches no value of PoseCoordPickMode -- N_CA_C and N_CA_C_CB both include N -- so the intent behind it is not recoverable. The surviving first branch is the correct one: it collects N, CA, C, O and CB, matching both the natom counting loop above it and the canonical case PoseCoordPickMode_BB in core/pose/xyzStripeHashPose.cc. Removing dead code, no behaviour change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each condition changed here tests the same operand twice, so a sibling operand is never tested and part of the check is dead code.
Behaviour fixes
core/energy_methods/CartesianBondedEnergy.cc—eval_singleres_torsion_derivativestests whether all four torsion atoms are ring atoms before handing the torsion off tocart_bonded_ring. It checkedatids[2]twice and neveratids[4]. The two sibling angle loops in the same file (over aSize3) correctly checkatids[1..3]; this one is over aSize4.core/chemical/rna/util.cc— in theSUGAR/SUGARCISblock ofget_base_pair_atoms, the third row of the 4×4 base-pair table is labelledaa1 == na_rad, which the adenine row above it already matches, so all four of its branches are unreachable. They belong to guanine:" H22", an atom that onlyRGUhas —RADhas" H2 "(seeRAD_n.params/RGU_n.params);na_rguis the onlyaa1value missing from the chain, which otherwise coversrad,rcy,uraagainst all fouraa2values.protocols/minimization_packing/DisulfideOptimizationMover.cc— the check documented as "Confirm that both are cysteine-type residues in a disulfide bond to each other" testedcys_pos[1]twice, socys_pos[2]was never validated. The error messages below it already reference both residues.protocols/environment/DofUnlock.cc— the environment-id half of the popped-passport check comparedpass_outto itself, so an environment-id mismatch was never caught. The error message below it reportspass_->env_id()as the expected value.protocols/pose_metric_calculators/RotamerRecovery.cc—runtime_assert( pose_rots.size() == pose_rots.size() )is always true; the neighbouring assert compares against the native, and this one should too.protocols/floppy_tail/FloppyTailMover.cc—flexible_chainappeared twice in the list of options incompatible with an explicit-in:file:movemap, soflexible_start_resnumwas never rejected even though the movemap overrides it. The user-facing message had the same duplication and is corrected to match.Behaviour-preserving removals
These duplicates are simply dead and removing them changes nothing:
protocols/cryst/wallpaper.cc—"C211"listed twice among the tetragonal groups (the file defines exactly seven distinct groups for that setting).protocols/antibody/design/CDRSeqDesignOptions.cc—"DISALLOWED"listed twice.protocols/simple_filters/SecretionPredictionFilter.ccandprotocols/protein_interface_design/movers/SecretionOptimizationMover.cc— thedG_insthreshold comparison repeated in the same&&chain, left over from extending the local-minimum test from ±1 to ±2.protocols/sic_dock/xyzStripeHashPoseWithMeta.hh—init_with_posetestedPoseCoordPickMode_BBtwice, making the second branch unreachable. Its body collects CA/C/CB, which matches no value ofPoseCoordPickMode(N_CA_CandN_CA_C_CBboth include N), so the intent behind it is not recoverable and the dead branch is removed. The surviving branch collects N/CA/C/O/CB, matching both thenatomcounting loop directly above it and the canonicalcase PoseCoordPickMode_BBincore/pose/xyzStripeHashPose.cc.Note on diff size
The diff is small relative to the usual bundling guidance because every fix is a one-line correction and this category is exhausted: the analysis pass was run over
utility/,basic/,core/,protocols/andnumeric/, andutility/,basic/andnumeric/produced no true positives. The remaining flagged sites are either thex != xNaN idiom or genuine "different conditions, same action" branches.