beneggett/sportradar-api

View on GitHub

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
Severity: Major
Found in lib/sportradar/api/baseball/game.rb - About 1 day to fix

    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
    
    
    Severity: Major
    Found in lib/sportradar/api/football/game.rb - About 1 day to fix

      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 = {}
      Severity: Major
      Found in lib/sportradar/api/basketball/game.rb - About 7 hrs to fix

        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
        Severity: Major
        Found in lib/sportradar/api/soccer/match.rb - About 7 hrs to fix

          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
          Severity: Minor
          Found in lib/sportradar/api/football/nfl.rb - About 6 hrs to fix

            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?
            Severity: Minor
            Found in lib/sportradar/api/soccer/player.rb - About 6 hrs 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

            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
            Severity: Minor
            Found in lib/sportradar/api/baseball/mlb.rb - About 6 hrs to fix

              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
              Severity: Minor
              Found in lib/sportradar/api/football/ncaafb.rb - About 6 hrs to fix

                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
                
                
                Severity: Minor
                Found in lib/sportradar/api/soccer/tournament.rb - About 5 hrs to fix

                  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
                  Severity: Minor
                  Found in lib/sportradar/api/baseball/game.rb - About 5 hrs to fix

                    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
                    Severity: Minor
                    Found in lib/sportradar/api/basketball/ncaamb.rb - About 5 hrs to fix

                      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
                      
                      
                      Severity: Minor
                      Found in lib/sportradar/api/soccer/competition.rb - About 5 hrs to fix

                        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"]
                        Severity: Minor
                        Found in lib/sportradar/api/soccer/match.rb - About 4 hrs 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

                        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
                        Severity: Minor
                        Found in lib/sportradar/api/football/play_statistics.rb - About 4 hrs to fix

                          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
                          Severity: Minor
                          Found in lib/sportradar/api/basketball/nba.rb - About 4 hrs to fix

                            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']
                            Severity: Minor
                            Found in lib/sportradar/api/football/play.rb - About 4 hrs 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

                            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
                            Severity: Minor
                            Found in lib/sportradar/api/soccer/match.rb - About 3 hrs to fix

                              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']
                              Severity: Minor
                              Found in lib/sportradar/api/baseball/player.rb - About 3 hrs 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

                              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
                              Severity: Minor
                              Found in lib/sportradar/api/football/game.rb - About 3 hrs to fix

                                Method update has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def update(data, **opts)
                                          if data["summaries"]
                                            update(data["summaries"][0])
                                          end
                                          if data["sport_event"]
                                Severity: Minor
                                Found in lib/sportradar/api/mma/fight.rb - About 3 hrs 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