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

src/platforms/platform.dom.js - mismatch in removeResizeListener parameters #5303

Closed
stefandrissen opened this issue Mar 1, 2018 · 4 comments
Milestone

Comments

@stefandrissen
Copy link

stefandrissen commented Mar 1, 2018

SonarQube is reporting a critical error on chartjs:

"removeResizeListener" declared at line 10762 expects 1 argument, but 2 were provided.

This is pointing to src/platforms/platform.dom.js

line 289: function removeResizeListener(node) {
...
line 420: 			removeResizeListener(canvas, listener);

Expected Behavior

Match the parameters.

Possible Solution

Do not attempt to pass listener.

Environment

  • Chart.js version: 2.7.1
  • Browser name and version: n/a
@stefandrissen stefandrissen changed the title src/platforms/platform.dom.js - mismatch in removeResizeListener parameter mismatch src/platforms/platform.dom.js - mismatch in removeResizeListener parameters Mar 1, 2018
@simonbrunel
Copy link
Member

Good catch, but how that can be a "critical error"? does this extra argument simply ignored?

@stefandrissen
Copy link
Author

That's just SonarQube's default, see https://rules.sonarsource.com/javascript/tag/cwe/RSPEC-930

@simonbrunel
Copy link
Member

Oh I see! Feel free to submit a PR with that extra arg removed :)

@simonbrunel
Copy link
Member

Fixed in #5970

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

No branches or pull requests

2 participants