Skip to content

Fix variable shadowing crash in get_by_tags and code quality improvements #836

@BEAST04289

Description

@BEAST04289

While reviewing the codebase for my GSoC 2026 Module B proposal, I found a crash bug and several code quality issues:

🔴 Crash Bug — get_by_tags() in db.py (line 984-1001): The loop variable node is shadowed by the return value of self.get_nodes(). When get_nodes() returns [] (empty list), the error handler tries to access node.name on the empty list, causing AttributeError. Fix: use a separate variable name for the query result.

Code quality fixes:

Unreachable return None after raise ValueError in add_node() (db.py:1585)
Duplicate import from application.utils import oscal_utils, redis in web_main.py (lines 15 and 20)
Misspelled variable pentalty in gap_analysis.py (lines 44-46)
Misspelled variable pending_stadards in cre_main.py (line 280)
I'll submit a PR with separate commits for each fix. All existing tests pass after changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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