codeclimate/codeclimate-bundler-audit

View on GitHub
lib/cc/engine/bundler_audit/unpatched_gem_remediation.rb

Summary

Maintainability
A
0 mins
Test Coverage

Do not use empty case condition, instead use an if expression.
Open

          case

This cop checks for case statements with an empty condition.

Example:

# bad:
case
when x == 0
  puts 'x is 0'
when y == 0
  puts 'y is 0'
else
  puts 'neither is 0'
end

# good:
if x == 0
  puts 'x is 0'
elsif y == 0
  puts 'y is 0'
else
  puts 'neither is 0'
end

# good: (the case condition node is not empty)
case n
when 0
  puts 'zero'
when 1
  puts 'one'
else
  puts 'more'
end

There are no issues that match your filters.

Category
Status