Skip to content

False positive: Cyclic import in Python #13866

Open
@abadger

Description

@abadger

Description of the false positive

CodeQL falsely detects a cyclic import in a Pull request.

  • There is an existing cyclic import in the code which is mitigated with an import inside of a function.

    toolopts imports global variables from systeminfo inside of _register_options()
    systeminfo imports toolopts

  • The pull request includes switching the python modules that the identifiers are being defined in and reversing the imports so that only one module has to import the other

    toolopts now implements the global variables
    toolopts no longer imports systeminfo at all
    systeminfo now imports the global variables from toolopts

Code samples or links to source code

URL to the alert on GitHub code scanning (optional)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions