Class | Nitpick::BranchNitpicker |
In: |
lib/nitpick/branch_nitpicker.rb
|
Parent: | Nitpicker |
# File lib/nitpick/branch_nitpicker.rb, line 3 def process_if(exp) cond = process(exp.shift) yes_branch = process(exp.shift) no_branch = process(exp.shift) scan_for [Warnings::UselessBranch, Warnings::IdenticalBranch], :with => [cond, yes_branch, no_branch] scan_for [Warnings::AssignmentAsCondition], :with => [cond] s(:if, cond, yes_branch, no_branch) end