estiens/caterpillar_rails

View on GitHub
app/models/response.rb

Summary

Maintainability
A
0 mins
Test Coverage

Re-enable Metrics/CyclomaticComplexity cop with # rubocop:enable after disabling it.
Open

  # rubocop:disable Metrics/CyclomaticComplexity
Severity: Minor
Found in app/models/response.rb by rubocop

Use the double pipe equals operator ||= instead.
Open

    interaction = fetch_interactions_for(@substance.name, @interaction_substance.name) unless interaction
Severity: Minor
Found in app/models/response.rb by rubocop

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

  # rubocop:disable Metrics/MethodLength
Severity: Minor
Found in app/models/response.rb by rubocop

There are no issues that match your filters.

Category
Status