Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Request: Add support for CoffeeScript #14

Open
daniellmb opened this issue Sep 11, 2013 · 10 comments
Open

Request: Add support for CoffeeScript #14

daniellmb opened this issue Sep 11, 2013 · 10 comments

Comments

@daniellmb
Copy link

I'd love to see support for CoffeeScript. A simple way to implement it would be to take files ending in .coffee, .litcoffee, .coffee.md and compiling them to javascript so they can be tested for complexity using exiting checks.

@nhunzaker
Copy link
Contributor

We'd love to see that as well. Unfortunately complexityReport, to our knowledge, doesn't support CoffeeScript. We'd need to explore other options.

One option that looks promising is coffeelint, do you know of any other code analysis tools for CS that might provide similar metrics to compexityReport?

I'd love to see this happen.

@daniellmb
Copy link
Author

I am using coffeelint but it is not as robust as complexityReport, that is why I suggested instead of trying to rewrite all that into CS, perhaps it could be reused by simply compiling CS to JS first. I haven't tried it but it could be a viable option.

@nhunzaker
Copy link
Contributor

In our experience we've found, while possible, it's hard to work with the compiled JS, it tends to give very flawed metrics. I'll hack on it and see what I can come up with.

@daniellmb
Copy link
Author

sweet, yeah and all the anonymous functions in CoffeeScript don't help either.

@leonelgalan
Copy link

Hey @nhunzaker, great tool! I tried the tool with compiled JS, and it still give me good insights on code that was too complex.

@nmccready
Copy link

👍

1 similar comment
@abarnwell
Copy link

+1

@nmccready
Copy link

I got it to work in gulp-complexity quite easily; my changes were rejected. So I should start an independent fork. https://github.com/nmccready/gulp-complexity

@nhunzaker
Copy link
Contributor

@nmccready cool! Would love to backport this to grunt-complexity. Do you just feed the coffeescript AST into escomplex?

@nmccready
Copy link

@nhunzaker I think the brunt of the work comes from this lib. https://github.com/jared-stilwell/escomplex-coffee

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

No branches or pull requests

5 participants