josephschmitt/Clamp.js

Refactor code to be more modular and use JsLint/JsHint

Opened this issue · 0 comments

Ill probably submit a merge request in my freetime; however, as it stands, functions are extremely large and complex and there is little encapsulation of features/functions even though the whole thing is defined in a closure.

The clamp function is HUGE. it creates utility subfunctions which should be defined externally to the function (its generally bad practice unless its a callback to a utility that you're using. like _.each )

there are missing semicolons, as well as the usage of global variables (why so afraid to use this?)

Infact self isnt used...

On that note.... use JSLint/JsHint its how I found a lot of these coding style challenges for such a useful library.