Showing 10 of 51 total issues
Method initialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(team_hash, conference = nil, division = nil, subdivision = nil)
if team_hash
@id = team_hash['id']
@name = team_hash['name']
@conference = conference
Method initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(team_hash, conference = nil, division = nil, subdivision = nil)
if team_hash
@id = team_hash['id']
@name = team_hash['name']
@conference = conference
- 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 initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(args={})
xml = args.fetch(:xml)
@year = args[:year] ? args[:year].to_i : nil
@season = args[:season] ? args[:season].to_sym : nil
@date = args[:date]
- 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 players_from_stats
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def players_from_stats
statistics.each_with_object({}) do |(key, data), players|
next unless data.is_a?(Hash)
if key == EXTRA_POINTS_KEY
data.each do |nested_key, nested_data|
- 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 game_roster
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def game_roster(year, season, week, home, away)
Method boxscore
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def boxscore(year, season, week, home, away)
Method game_statistics
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def game_statistics(year, season, week, home, away)
Method play_by_play
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def play_by_play(year, season, week, home, away)
Method parse_player_statistics
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_player_statistics(stats_hash)
players = []
stats_hash.keys.each do |key|
next if !stats_hash[key]['players']
stats_hash[key]['players'].each do |p|
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(args={})
xml = args.fetch(:xml)
@year = args[:year] ? args[:year].to_i : nil
@season = args[:season] ? args[:season].to_sym : nil
- 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"