Method check_index
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def check_index
if request.get?
@errors << 'Missing client_id.' unless (@client_id = params[:client_id])
if (@response_type = params[:response_type])
@errors << 'Invalid response_type.' unless @response_type == 'code'
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method callback
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def callback
redirect_uri = nil
error = params[:error]
if (cenit_token = CallbackAuthorizationToken.where(token: params[:state] || session[:oauth_state]).first) &&
(User.current = cenit_token.set_current_tenant!.owner) && (auth = cenit_token.authorization)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method index
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def index
skip_consent = false
if request.get?
if @errors.blank?
if @app_id && (@app_id.tenant == Account.current || @app_id.registered?)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method token
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def token
response = {}
response_code = :bad_request
errors = ''
token_class =
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method callback
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def callback
redirect_uri = nil
error = params[:error]
if (cenit_token = CallbackAuthorizationToken.where(token: params[:state] || session[:oauth_state]).first) &&
(User.current = cenit_token.set_current_tenant!.owner) && (auth = cenit_token.authorization)
Method index
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
skip_consent = false
if request.get?
if @errors.blank?
if @app_id && (@app_id.tenant == Account.current || @app_id.registered?)
Method token
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def token
response = {}
response_code = :bad_request
errors = ''
token_class =