Showing 185 of 185 total issues
Class Game
has 71 methods (exceeds 20 allowed). Consider refactoring. Open
class Game < Data
attr_accessor :response, :id, :title, :home_id, :away_id, :score, :status, :coverage, :scheduled, :venue, :broadcast, :duration, :attendance, :team_stats, :player_stats, :changes, :lineup
attr_reader :inning, :half, :outs, :bases, :pitchers, :final, :rescheduled, :inning_over
attr_reader :outcome, :count
Class Game
has 71 methods (exceeds 20 allowed). Consider refactoring. Open
class Game < Data
attr_accessor :response, :id, :title, :home_id, :away_id, :score, :status, :coverage, :scheduled, :venue, :broadcast, :duration, :attendance, :team_stats, :player_stats, :changes, :lineup, :week, :quarter, :clock, :api
attr_reader :week_number, :year, :type
Class Match
has 55 methods (exceeds 20 allowed). Consider refactoring. Open
class Match < Data
attr_reader :id, :league_group, :scheduled, :start_time_tbd, :status, :tournament_round, :match_status, :venue
attr_reader :home_score, :away_score, :winner_id, :aggregate_home_score, :aggregate_away_score, :aggregate_winner_id
attr_reader :referee, :weather_info, :coverage_info, :probabilities
attr_reader :home, :away, :tournament_id
Class Game
has 55 methods (exceeds 20 allowed). Consider refactoring. Open
class Game < Data
attr_accessor :response, :id, :title, :home_id, :away_id, :score, :status, :coverage, :time_zone, :scheduled, :venue, :broadcast, :clock, :duration, :attendance, :team_stats, :player_stats, :changes, :media_timeouts
attr_accessor :period
@all_hash = {}
Class Nfl
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class Nfl < Data
attr_accessor :response, :id, :name, :alias, :type, :season
def all_attributes
[:name, :alias, :leagues, :divisions, :teams]
end
Method set_game_stats
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def set_game_stats(data)
@game_stats ||= {}
@game_stats[:substituted_in] = data['substituted_in'] if data['substituted_in'].present?
@game_stats[:substituted_out] = data['substituted_out'] if data['substituted_out'].present?
- 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
Class Mlb
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class Mlb < Data
attr_accessor :response, :id, :name, :alias, :year, :type
def all_attributes
[:name, :alias, :leagues, :divisions, :teams]
end
Class Ncaafb
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class Ncaafb < Data
attr_accessor :response, :id, :name, :alias, :type
def all_attributes
[:name, :alias, :leagues, :divisions, :teams]
end
Class Tournament
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class Tournament < Data
attr_reader :id, :league_group, :name, :category, :coverage_info, :live_coverage, :season_coverage_info
alias :display_name :name
alias :alias :name
File game.rb
has 402 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sportradar
module Api
module Baseball
class Game < Data
attr_accessor :response, :id, :title, :home_id, :away_id, :score, :status, :coverage, :scheduled, :venue, :broadcast, :duration, :attendance, :team_stats, :player_stats, :changes, :lineup
Class Ncaamb
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class Ncaamb < Data
attr_accessor :response, :id, :name, :alias
def all_attributes
[:name, :alias, :conferences, :divisions, :teams]
end
Class Competition
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class Competition < Data
attr_reader :id, :league_group, :name, :category, :coverage_info, :live_coverage, :season_coverage_info
alias :display_name :name
alias :alias :name
Method update
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def update(data, **opts)
if data["sport_event"]
update(data["sport_event"])
end
if data["sport_event_status"]
- 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
File play_statistics.rb
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sportradar
module Api
module Football
class PlayStatistics < Data
attr_accessor :response, :kick, :return, :rush, :defense, :receive, :punt, :penalty, :pass, :first_down, :field_goal, :extra_point, :defense, :down_conversion, :fumble
Class Nba
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Nba < Data
attr_accessor :response, :id, :name, :alias
def all_attributes
[:name, :alias, :conferences, :divisions, :teams]
end
Method update
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def update(data, **opts)
@api = opts[:api] || @api
@drive = opts[:drive] || @drive
@description = data["description"] || data['summary'] || @description
@alt_description = data['alt_description'] if data['alt_description']
- 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
File match.rb
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sportradar
module Api
module Soccer
class Match < Data
attr_reader :id, :league_group, :scheduled, :start_time_tbd, :status, :tournament_round, :match_status, :venue
Method update
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def update(data, **opts)
@depth = data['depth'] if data['depth']
@experience = data['experience'] if data['experience']
@birth_place = data['birth_place'].gsub(',,', ', ') if data['birth_place']
@college = data['college'] if data['college']
- 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
File game.rb
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sportradar
module Api
module Football
class Game < Data
attr_accessor :response, :id, :title, :home_id, :away_id, :score, :status, :coverage, :scheduled, :venue, :broadcast, :duration, :attendance, :team_stats, :player_stats, :changes, :lineup, :week, :quarter, :clock, :api
Method update
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def update(data, source: nil, **opts)
@response.merge!(data)
# via pbp
@status = data['status'] if data['status']
@coverage = data['coverage'] if data['coverage']
- 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"