Showing 102 of 185 total issues
Method update
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update(data, **opts)
if data["summaries"]
update(data["summaries"][0])
end
if data["sport_event"]
Method update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update(data, source: nil, **opts)
# update stuff
@id = data['id'] if data['id']
@season = data['season'] if data['season']
@type = data['type'] if data['type']
- 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 ingest_pbp
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def ingest_pbp(data)
period_name = 'periods'
update(data, source: :pbp)
period_data = if data[period_name] && !data[period_name].empty?
@period = data[period_name].last['sequence'].to_i
- 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 handle_names
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def handle_names(data)
# need to do some more work here
@name = data['name'] if data['name']
if data['name'] && !data.key?('market')
@full_name = data['name']
- 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 advance_inning
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def advance_inning
@inning_over = false
return unless count['outs'] == 3
if count['inning'] >= 9
if count['inning_half'] == 'T' && leading_team_id == home.id
- 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 update_teams
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_teams(data)
if data['summary']
@home.update(data.dig('summary', 'home'), game: self)
@away.update(data.dig('summary', 'away'), game: self)
else
- 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 update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update(data, source: nil, **opts)
@id = data['id'] || @id
# @year = data['year'] || @week&.season.year
# @type = data['type'] || @week&.season.type
# @week_number = data['week'] || @week&.sequence
- 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 end_reason_possibilities
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_reason_possibilities
[
'UNKNOWN',
'Touchdown',
'Safety',
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(data)
@response = data
@id = data["id"]
@type = data["type"]
@time = data["time"]
Method update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update(data, **opts)
@id = data['id'] if data['id']
@league_group = opts[:league_group] || data['league_group'] || @league_group
if data['player']
Method tournament_ids
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.tournament_ids
@tournament_ids ||= {
# Europe group
'eu.uefa_champions_league' => "sr:tournament:7",
'eu.la_liga' => "sr:tournament:8",
Method tournament_ids
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.tournament_ids
@tournament_ids ||= {
# Europe group
'eu.uefa_champions_league' => "sr:tournament:7",
'eu.la_liga' => "sr:tournament:8",
Method parse_description_for_drive_end
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_description_for_drive_end
parsed_ending = case @description
when /no play/i
nil
when /intercepted/i
Method update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update(data, **opts)
@season = opts[:season] if opts[:season]
@status = data['status'] if data['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
Method next_batters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def next_batters(team, number_of_upcoming_batters = 3)
if team == 'home'
last_at_bat = game.at_bats.select{|at_bat| at_bat.event.half_inning.half == 'B'}.last
if last_at_bat
last_position = @home.detect{|htl| htl['id'] == last_at_bat.hitter_id}&.dig('order')
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update(data, **opts)
@round = data['round'] if data['round'] # "3",
@time = data['time'] if data['time'] # "05:00",
@outcome = data['method'] if data['method'] # "Decision - Split",
@submission = data['submission'] if data['submission'] # "",
- 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 parse_flags
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_flags(data)
@is_ab_over = data['is_ab_over'] if data['is_ab_over']
@is_bunt = data['is_bunt'] if data['is_bunt']
@is_bunt_shown = data['is_bunt_shown'] if data['is_bunt_shown']
@is_hit = data['is_hit'] if data['is_hit']
- 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 update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update(data, **opts)
handle_names(data)
@venue = Venue.new(data['venue']) if data['venue']
@alias = data['abbr'] if data['abbr']
- 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 event_manifests
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def event_manifests
# /[league]/[image_type]/events/[year]/[month]/[day]/manifest.[format]?api_key={your_api_key}
raise Sportradar::Api::Error::InvalidType unless date.present? || event_id.present?
@live_image_request = true
if event_id.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
Method parse_statistics
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_statistics(data)
return unless data['statistics']
@statistics = data['statistics']
stat = @statistics.detect { |hash| hash['type'] == base_key }
# stat = data.dig('statistics', base_key) rescue data.dig('statistics', 0, base_key)
- 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"