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

Please lint your code! #60

Open
mpetrovich opened this issue Sep 19, 2014 · 0 comments
Open

Please lint your code! #60

mpetrovich opened this issue Sep 19, 2014 · 0 comments

Comments

@mpetrovich
Copy link

You have a number of leaked globals and typos that could cause issues for other scripts. Any serious third-party library should have basic linting.

Using the popular JSHint tool, I was able to find a number of potentially serious issues:

Circle area calculation is completely wrong due to a typo in path.coffee:
area: ->
        me = @
        Math.PI * me.r*m.r  // "m.r" should be "me.r"
Line.clipToBBox() references a non-existent len() function:
                if p1x != x1 or p1y != y0 or i == len(self.points)-2
                    pts.push([x1, y1])
scale.identity() has an incorrect signature, causing the wrong values to be passed to the Scale constructor:
scale.identity = (s) ->
    new Scale(domain, prop, filter).rangedScale  // domain, prop, filter should be arguments to identity()

These are just a few of the warnings & errors reported by a linter like JSHint. Most of these are trivial to fix and are pretty silly to see in such a popular third-party library.

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

No branches or pull requests

1 participant