Skip to content

Undefined variable "n" in "_Dendrogram.get_color_dict" #2806

Closed
@nicolas-harraudeau-sonarsource

Description

Hello,

While analyzing plotly.py on SonarCloud I saw what looks like an error in packages/python/plotly/plotly/figure_factory/_dendrogram.py:

Screenshot 2020-10-02 at 16 15 42

You can see the issue in SonarCloud here.

In this context the variable n is not defined. It is probable that the developer intended to write nc instead of n as she/he/they did a few lines above.

The resulting code would be

default_colors[nc] = "rgb(0,116,217)"

In case you want to scan Plotly on SonarCloud here is what the configuration looks like with Github actions and here is the config if you prefer to let SonarCloud scan your project by itself. It is free for open source projects.

Activity

added a commit that references this issue on Oct 12, 2020
6bc5b41
added a commit that references this issue on Jan 29, 2021
6bcef8d
added a commit that references this issue on Oct 21, 2021
efde794
gvwilson

gvwilson commented on Jun 18, 2024

@gvwilson
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @gvwilson@nicolas-harraudeau-sonarsource

      Issue actions

        Undefined variable "n" in "_Dendrogram.get_color_dict" · Issue #2806 · plotly/plotly.py