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

[Question] Provide details on how complexity is calculated #26

Closed
peterschussheim opened this issue May 27, 2017 · 2 comments
Closed

[Question] Provide details on how complexity is calculated #26

peterschussheim opened this issue May 27, 2017 · 2 comments

Comments

@peterschussheim
Copy link

Hi,

Recently started using this extension and it is neat however a brief explanation would be useful to myself and perhaps other users.

thanks,
Peter

@kisstkondoros
Copy link
Owner

Hi,

It is a pretty straight forward process (it is inspired by Cyclomatic complexity).

  1. take the source code
  2. transform it to abstract syntax tree
  3. traverse the tree
  4. use assigned complexity values / visibility settings from the configuration (see package.json for available settings under codemetrics.nodeconfiguration)
  5. accumulate the subtotals for each node
  6. display the result
  7. be happy 😄

I hope this answered your question. If not feel free to reopen the issue / file a new one and I'll further elaborate it.

@peterschussheim
Copy link
Author

@kisstkondoros Thank you for the explanation, this helps! 🥇

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