Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nicolas-harraudeau-sonarsource opened this issue Oct 2, 2020 · 1 comment · May be fixed by #2828
Closed

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

nicolas-harraudeau-sonarsource opened this issue Oct 2, 2020 · 1 comment · May be fixed by #2828

Comments

@nicolas-harraudeau-sonarsource
Copy link

nicolas-harraudeau-sonarsource commented Oct 2, 2020

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.

tipabu added a commit to tipabu/plotly.py that referenced this issue Oct 12, 2020
new_old_color_map is hardcoded, and default_colors has a minimal key set
that includes all the values.

Drive-by: simplify the overlay of rgb_colorscale onto default_colors.

Closes plotly#2806
tipabu added a commit to tipabu/plotly.py that referenced this issue Jan 29, 2021
new_old_color_map is hardcoded, and default_colors has a minimal key set
that includes all the values.

Drive-by: simplify the overlay of rgb_colorscale onto default_colors.

Closes plotly#2806
tipabu added a commit to tipabu/plotly.py that referenced this issue Oct 21, 2021
new_old_color_map is hardcoded, and default_colors has a minimal key set
that includes all the values.

Drive-by: simplify the overlay of rgb_colorscale onto default_colors.

Closes plotly#2806
@gvwilson
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants