mhuggins/lol_client

View on GitHub

Showing 2 of 12 total issues

Class LolClient has 27 methods (exceeds 20 allowed). Consider refactoring.
Open

class LolClient
  REGIONS = [:br, :eune, :euw, :kr, :lan, :las, :na, :oce, :ru, :tr].to_set.freeze

  CHALLENGER_LEAGUE_TYPES = [:RANKED_SOLO_5x5, :RANKED_TEAM_3x3, :RANKED_TEAM_5x5].to_set.freeze

Severity: Minor
Found in lib/lol_client.rb - About 3 hrs to fix

    Method assign_base_attributes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def assign_base_attributes(obj, base)
          obj.class.defined_attributes.each do |attr|
            obj_value = obj.public_send(attr)
            base_value = base.public_send(attr)
    
    
    Severity: Minor
    Found in lib/lol_client/representers/basic_data_representable.rb - About 45 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language