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

Is there any way to run codemetrics on all files in workspace? #32

Closed
pmunin opened this issue Aug 13, 2017 · 5 comments
Closed

Is there any way to run codemetrics on all files in workspace? #32

pmunin opened this issue Aug 13, 2017 · 5 comments

Comments

@pmunin
Copy link

pmunin commented Aug 13, 2017

Is there any way to run codemetrics on all files in workspace? And/or integrate it into a es/ts linters, webpack?

@kisstkondoros
Copy link
Owner

At the moment no, however one can build a webpack plugin using tsmetrics-core.

I can not support You with that now, but I'll come back to this request in about a week or two (I'll be offline for some days).

@kisstkondoros
Copy link
Owner

So finally I had some hours trying a few things out:

  • running codemetrics on all files in the workspace is not possible at the moment, and even if it would run it would just populate the "problems view", I see not much benefit for this
  • writing an es/ts linter plugin is a nice idea, I might try it later on, but it seems to be complicated at the first glance
  • webpack plugin, with this one I've messed around, I was wondering about publish it on npm, but at the moment it does not adds any value to the development process I think. Even if You integrate it in Your build, what's the benefit? Do you have an idea what should it do in addition? Highlight problematic files or parts of files? IDK
    https://gist.github.com/kisstkondoros/ad1cc7d385abcbf824cf63b3f54476f2

@pmunin
Copy link
Author

pmunin commented Aug 25, 2017

Well the purpose of this tool would be similar to any other linter - quality control of the code on compilation time. So an output should contain, all code pointers to where code is too complicated. Config should allow to set threshold of levels of complexity and prefilter output based on those levels.

@kisstkondoros
Copy link
Owner

Well, that's fair enough, but sometimes it's ok that something is complicated (high complexity) and showing it always might get annoying. I'll publish the existing stuff to npm with the suggested additional filtering options. I'll post a link here of the new repo and we can iterate over the idea further there :-)

@kisstkondoros
Copy link
Owner

So here it is: https://github.com/kisstkondoros/tsmetrics-webpack-plugin
Also as an npm package: https://www.npmjs.com/package/tsmetrics-webpack-plugin

I'm closing this issue now, but feel free to open new ones in the linked repo 🎆

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

2 participants