Skip to content

Need Clarification on 3rd Alert Category #4

@donaldmurf

Description

@donaldmurf

Screenshot from 2024-06-24 16-00-46

The third category for alerts is "Ineffective Code CERT ID MSC12-C CWE ID 561".

MSC12-C says "Code that has no effect or is never executed (that is, dead or unreachable code)"

CWE 561 says "Dead code is code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed."

In the Alert Categories it seems to jump from MSC12-C to EXP12-C. EXP12-C say "Do not ignore values returned by functions".

I've put a red box around the deadcode part and a blue box around EXP12-C.

I ran example 1 from EXP12-C and cppcheck does not recognize EXP12-C, so no repairs were made to it.
I ran some examples of dead code, which cppcheck detected, but no fixes were made to the deadcode.

Can you please clarify exactly what the 3rd Alert is, and how redemption fixes it? Is redemption supposed to remove deadcode from the sourcefile?

In the SEI Research and Review, it appears the 3rd category is supposed to be MSC12-C.
Screenshot from 2024-06-24 16-45-23

Here is an example of some deadcode I tried to have repaired. The left is repaired. You can see myint was changed to myint =0. However, none of the deadcode was changed.
image

Here is a snippet from the alerts.json showing cppcheck found the error and it was converted into a .json file.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions