varvet/pundit

View on GitHub

Showing 2 of 2 total issues

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

def initialize(options = {})
if options.is_a? String
message = options
else
@query = options[:query]
Severity: Minor
Found in lib/pundit.rb - About 25 mins to fix

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

def cached_find(record)
policy_cache.fetch(user: user, record: record) do
klass = yield policy_finder(record)
next unless klass
 
 
Severity: Minor
Found in lib/pundit/context.rb - About 25 mins to fix
Severity
Category
Status
Source
Language