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

Typescript - Complexity information shown on classes but not on functions #13

Closed
pbalaga opened this issue Mar 12, 2017 · 2 comments
Closed

Comments

@pbalaga
Copy link

pbalaga commented Mar 12, 2017

Hi, I've just installed the extension (v 1.2.0) in VS Code. It shows complexity at the top of a class declaration, but not for individual methods. Having seen the example screenshots, it may not be working as designed. I would expect complexity to be shown on top of functions. Additionally, it seems class complexity is calculated as sum of member complexities, which is arguably OK, but is there would need to be different complexity limits for classes and class memebers. (5 max limit is good for functions, but not so much for classes - code in the below example already breaks the limit.)

image

@kisstkondoros
Copy link
Owner

Hi,

What you experience here is the effect of the configuration option: "codemetrics.basics.CodeLensHiddenUnder" the default of this is 3, this means that every codelens with complexity 3 and below is going to be hidden, you can change this to be 0 so that you see every single one of them.

it seems class complexity is calculated as sum of member complexities

Right, I haven't implemented a special case for classes. If you have an idea how it can be done in a better way, feel free to open a PR or just describe what you would expect there.

@pbalaga
Copy link
Author

pbalaga commented Mar 12, 2017

Thanks, this makes sense.

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