Commit graph

5 commits

Author SHA1 Message Date
Vitalii Elenhaupt
1fc0c525bd
Do not report unneeded disable directive if directive is used one line above 2018-05-09 00:14:46 +03:00
V. Elenhaupt
6475c2bb25
Variable scope & useless assignments (#41)
* 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?
2018-05-03 18:57:47 +03:00
Vitalii Elenhaupt
eda5960b0f Check for unneeded directives when all other rules are done 2018-02-02 22:17:04 +02:00
Vitalii Elenhaupt
6fb483a2dd Prevent disabling of UnneededDisableDirective rule 2018-02-02 22:17:04 +02:00
Vitalii Elenhaupt
8075c39aa9 Unneeded disable directive 2018-02-02 22:17:04 +02:00