Skip to content

Clean up dead branches caused by hard-coded local flags #11533

@dareumnam

Description

@dareumnam

Issue overview

Cppcheck is flagging a couple of knownConditionTrueFalse cases that look like dead branch logic caused by hard-coded local flags.

Two current examples:

  1. In ThermalISO15099Calc::Calc_ISO15099 (here and there), UnshadedDebug is initialized to 0 with a comment indicating unshaded debug output was removed for now. Both if (files.WriteDebugOutput && (UnshadedDebug == 1)) blocks are therefore unreachable. This looks like leftover disabled debug code.
  2. In WindowEquivalentLayer::VB_SOL46_CURVE (here), CORR is initialized to 1 and never modified, so if (CORR > 0) is always true and the else path is unreachable. This looks like leftover on/off flag logic for slat-curvature correction rather than an active runtime branch.

Suggested cleanup:

  • remove dead branches if the behavior is intentionally fixed/disabled, or
  • reconnect the flags to real configuration/input paths if they are supposed to remain functional.

It would also reduce cppcheck noise and make the code intent clearer.

Operating System (Multiple choices)

Windows

Operating System Version

11

Version of EnergyPlus

26.1.0

Unmethours link or helpdesk ticket number

N/A

Defect file

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DefectIncludes code to repair a defect in EnergyPlusUnconfirmedDefectDefect has not yet confirmed to be an actual issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions