c3gdlk/rubyboost

View on GitHub
app/controllers/concerns/simple_resource.rb

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

Method save_resource_and_respond! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def save_resource_and_respond!(options={}, &block)
result = resource.update(permitted_params)
 
unless result.present?
resource.errors[:base] << 'Something goes wrong'
Severity: Minor
Found in app/controllers/concerns/simple_resource.rb - About 35 mins to fix

Method association_chain_by_context has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def association_chain_by_context
context_method = self.class.resource_context.to_sym
 
if self.respond_to? context_method, true
context = send(context_method)
Severity: Minor
Found in app/controllers/concerns/simple_resource.rb - About 25 mins to fix

There are no issues that match your filters.

Category
Status