app/models/response.rb
Re-enable Metrics/CyclomaticComplexity cop with # rubocop:enable
after disabling it. Open
Open
# rubocop:disable Metrics/CyclomaticComplexity
- Exclude checks
Use the double pipe equals operator ||=
instead. Open
Open
interaction = fetch_interactions_for(@substance.name, @interaction_substance.name) unless interaction
- Read upRead up
- Exclude checks
This cop checks for potential usage of the ||=
operator.
Example:
# bad
name = name ? name : 'Bozhidar'
# bad
name = if name
name
else
'Bozhidar'
end
# bad
unless name
name = 'Bozhidar'
end
# bad
name = 'Bozhidar' unless name
# good - set name to 'Bozhidar', only if it's nil or false
name ||= 'Bozhidar'
Re-enable Metrics/MethodLength cop with # rubocop:enable
after disabling it. Open
Open
# rubocop:disable Metrics/MethodLength
- Exclude checks