Skip to content

pySCG, better code examples for CWE-783: Operator Precedence Logic Error #992

@myteron

Description

@myteron

Need to come with better code examples as per comments below:

The “Non-Compliant” snippet uses pure expressions (bit ops, tuple permutation) with no side effects. The introduction claims risk from “expressions that read & write to the same object”.

The compliant solution has identical output. While it's certainly much easier to understand and maintain,
given the introduction I would expect examples that demonstrate "unintended side effects" or a result that is "surprising and incorrect"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions