nicholalexander/clarification

View on GitHub

Showing 4 of 4 total issues

Method build_concept_objects has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def build_concept_objects
begin
concepts = @response_json.fetch("outputs").fetch(0).fetch("data", nil).fetch("concepts", nil)
rescue StandardError => e
Severity: Minor
Found in lib/clarification/objectifier.rb - About 1 hr to fix

Method build_concept_objects has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def build_concept_objects
begin
concepts = @response_json.fetch("outputs").fetch(0).fetch("data", nil).fetch("concepts", nil)
rescue StandardError => e
Severity: Minor
Found in lib/clarification/objectifier.rb - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    def train_model
    if @raw_response['status']['code'] == 10000
    Model.new(id: @raw_response['model']['id'],
    name: @raw_response['model']['name'])
    Severity: Minor
    Found in lib/clarification/response/train_response.rb and 1 other location - About 15 mins to fix
    lib/clarification/response/train_response.rb on lines 9..12

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    def create_model
    if @raw_response['status']['code'] == 10000
    Model.new(id: @raw_response['model']['id'],
    name: @raw_response['model']['name'])
    Severity: Minor
    Found in lib/clarification/response/train_response.rb and 1 other location - About 15 mins to fix
    lib/clarification/response/train_response.rb on lines 16..19
    Severity
    Category
    Status
    Source
    Language