forked from phoedos/pmd
simplify UnnecessaryBlock xpath rule
This commit is contained in:
@ -224,13 +224,17 @@ be misleading. Considering removing this unnecessary Block.
|
||||
<property name="xpath">
|
||||
<value>
|
||||
<![CDATA[
|
||||
//Block[not(parent::FunctionNode or parent::IfStatement or parent::ForLoop or parent::ForInLoop or parent::ForOfLoop
|
||||
or parent::WhileLoop or parent::DoLoop or parent::TryStatement or parent::CatchClause
|
||||
or parent::VariableDeclarator or parent::ImportDeclaration)]
|
||||
|
|
||||
//Scope[not(parent::FunctionNode or parent::IfStatement or parent::ForLoop or parent::ForInLoop or parent::ForOfLoop
|
||||
or parent::WhileLoop or parent::DoLoop or parent::TryStatement or parent::CatchClause
|
||||
or parent::VariableDeclarator or parent::ImportDeclaration)]
|
||||
//(Block|Scope)
|
||||
[not(
|
||||
parent::FunctionNode or
|
||||
parent::IfStatement or
|
||||
parent::ForLoop or
|
||||
parent::ForInLoop or
|
||||
parent::WhileLoop or
|
||||
parent::DoLoop or
|
||||
parent::TryStatement or
|
||||
parent::CatchClause
|
||||
)]
|
||||
]]>
|
||||
</value>
|
||||
</property>
|
||||
|
Reference in New Issue
Block a user