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
Hk cyclomatic complexity #92
Hk cyclomatic complexity #92
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
- Please move files to metrics directory (instead of metric)
- Would love to see some more tests covering all code blocks separately. But thatβs optional, i can merge and add them by my self if you wish
`Tuple` is stack based, whereas `Array` is allocated on the heap increasing GC pressure.
I think this is now ready for review, thanks for the comments! |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, that indentation rly sucks, looks like a formatter bug to me...
Yes looks pretty horrible, but oh well π€·πΌββοΈ |
FYI one of the most complex methods in crystal repo (level of complexity: 513) https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/syntax/lexer.cr#L90-L1229 |
@veelenga whooaaa, I thought that scrolling will never end... |
Haha that's a good one π€£ Btw 10 as the threshold was just a wild guess. Rubocop has is set to 6, swiftlint warns at 10, errors at 20. Some python tool says 10 is still a B. Credos default is at 9, I'd be fine with 10 as a default! |
Thank you guys. Good work |
Adresses #91. Just fyi that I tried this. Uses the same logic as rubocop does. I might go ahead and extract this CountingVisitor into a separate file and add more test coverage. I kind of works π€·πΌββοΈ Was easy, mad props on the architecture!