devcongress/elections-api

View on GitHub

Showing 3 of 3 total issues

Method parse_params has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def parse_params(options)
type = options.delete(:type) || self.class.controller_name.dasherize
required = options.delete(:require)
unless params[:type] == type
render status: :unprocessable_entity, json: errors.append(
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

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

    def ensure_payload_conforms_to_jsonapi_format
    unless params[:type]
    errors.append(
    source: :type,
    status: :unprocessable_entity,
    Severity: Minor
    Found in app/controllers/application_controller.rb - About 35 mins to fix

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

    def parse_params(options)
    type = options.delete(:type) || self.class.controller_name.dasherize
    required = options.delete(:require)
    unless params[:type] == type
    render status: :unprocessable_entity, json: errors.append(
    Severity: Minor
    Found in app/controllers/application_controller.rb - About 25 mins to fix
    Severity
    Category
    Status
    Source
    Language