* Proof of concept for cyclomatic complexity
* Enable configurability of rule
* Use the same nodes to increment the complexity as rubocop
* Fix typo in test description
* Properly indent code and simplify macro
* Move metric into metrics
* Cover a violation supressed by increased threshold
* Extract visitor into its own file
* Document cyclomatic complexity rule and visitor
* Refactor specs to use a macro
* Indent code inside macro
* Replace array with tuple for string formatting.
`Tuple` is stack based, whereas `Array` is allocated on the heap increasing GC pressure.
* Fix formatting
* Enable cyclomatic complexity rule by default
* AST::Visitor -> AST::NodeVisitor
* Scope & ScopeVisitor
* Useless assignment rule
* Instance vars and useless assignments
* Multiple assigns one by one
* Support outer scope
* Variable used in the useless assignment
* Support OpAssign & MultiAssign
* Captured by block
* Variable, Assignment, Reference & Refactoring
* Variable has references, Assignment can be referenced
* Branch entity
* Handle useless assignments in branches
* Handle assignments in a loop
* Handle branch equality
* Handle special var `$?` assignment
* Improve captured by block stuff
* Avoid assignments in property definitions
(UselessAssign rule reports an warning)
* Support MacroIf and MacroFor branches
* Handle assignments with shadowed vars in inner scopes
* Add method arguments as scope variables
* Handle case if branch is blank
* Top level scope
* Handle case when branch is nop?
* Performance improvements
Two main changes:
1. Cache parsed AST in a Source. So Parser will parse content only once.
2. Use one unified visitor with multiple callbacks instead of multiple
visitors to traverse AST.
This improves performance significantly, for example running it on
Crystal repository takes ~1 second, which 6 times faster than before.
* Change readme example