beneggett/sportradar-api

View on GitHub

Showing 83 of 185 total issues

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        def rushing
          @rushing ||= if response["rushing"]
            response["rushing"] = parse_out_hashes response["rushing"]
            Sportradar::Api::Football::StatPack::Rushing.new(response["rushing"])
          end
Severity: Major
Found in lib/sportradar/api/football/game_stats.rb and 7 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 49..54
lib/sportradar/api/football/game_stats.rb on lines 77..82
lib/sportradar/api/football/game_stats.rb on lines 84..89
lib/sportradar/api/football/game_stats.rb on lines 91..96
lib/sportradar/api/football/game_stats.rb on lines 105..110
lib/sportradar/api/football/game_stats.rb on lines 112..117
lib/sportradar/api/football/game_stats.rb on lines 133..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        def passing
          @passing ||= if response["passing"]
            response["passing"] = parse_out_hashes response["passing"]
            Sportradar::Api::Football::StatPack::Passing.new(response["passing"])
          end
Severity: Major
Found in lib/sportradar/api/football/game_stats.rb and 7 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 42..47
lib/sportradar/api/football/game_stats.rb on lines 49..54
lib/sportradar/api/football/game_stats.rb on lines 84..89
lib/sportradar/api/football/game_stats.rb on lines 91..96
lib/sportradar/api/football/game_stats.rb on lines 105..110
lib/sportradar/api/football/game_stats.rb on lines 112..117
lib/sportradar/api/football/game_stats.rb on lines 133..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

        def api_key
          if !['trial', 'sim'].include?(access_level) || (access_level == 'sim' && default_access_level == 'production')
            Sportradar::Api.api_key_params("mma", 'production')
          else
            Sportradar::Api.api_key_params("mma")
Severity: Minor
Found in lib/sportradar/api/mma/api.rb and 4 other locations - About 15 mins to fix
lib/sportradar/api/basketball/nba/api.rb on lines 41..46
lib/sportradar/api/basketball/ncaamb/api.rb on lines 41..46
lib/sportradar/api/odds/api.rb on lines 40..45
lib/sportradar/api/soccer/api.rb on lines 39..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        def misc_returns
          @misc_returns ||= if response["misc_returns"]
            response["misc_returns"] = parse_out_hashes response["misc_returns"]
            Sportradar::Api::Football::StatPack::MiscReturns.new(response["misc_returns"])
          end
Severity: Major
Found in lib/sportradar/api/football/game_stats.rb and 7 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 42..47
lib/sportradar/api/football/game_stats.rb on lines 49..54
lib/sportradar/api/football/game_stats.rb on lines 77..82
lib/sportradar/api/football/game_stats.rb on lines 91..96
lib/sportradar/api/football/game_stats.rb on lines 105..110
lib/sportradar/api/football/game_stats.rb on lines 112..117
lib/sportradar/api/football/game_stats.rb on lines 133..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        def int_returns
          @int_returns ||= if response["int_returns"]
            response["int_returns"] = parse_out_hashes response["int_returns"]
            Sportradar::Api::Football::StatPack::IntReturns.new(response["int_returns"])
          end
Severity: Major
Found in lib/sportradar/api/football/game_stats.rb and 7 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 42..47
lib/sportradar/api/football/game_stats.rb on lines 49..54
lib/sportradar/api/football/game_stats.rb on lines 77..82
lib/sportradar/api/football/game_stats.rb on lines 84..89
lib/sportradar/api/football/game_stats.rb on lines 91..96
lib/sportradar/api/football/game_stats.rb on lines 112..117
lib/sportradar/api/football/game_stats.rb on lines 133..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        def fumbles
          @fumbles ||= if response["fumbles"]
            response["fumbles"] = parse_out_hashes response["fumbles"]
            Sportradar::Api::Football::StatPack::Fumbles.new(response["fumbles"])
          end
Severity: Major
Found in lib/sportradar/api/football/game_stats.rb and 7 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 42..47
lib/sportradar/api/football/game_stats.rb on lines 49..54
lib/sportradar/api/football/game_stats.rb on lines 77..82
lib/sportradar/api/football/game_stats.rb on lines 84..89
lib/sportradar/api/football/game_stats.rb on lines 91..96
lib/sportradar/api/football/game_stats.rb on lines 105..110
lib/sportradar/api/football/game_stats.rb on lines 133..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        def defense
          @defense ||= if response["defense"]
            response["defense"] = parse_out_hashes response["defense"]
            Sportradar::Api::Football::StatPack::Defense.new(response["defense"])
          end
Severity: Major
Found in lib/sportradar/api/football/game_stats.rb and 7 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 42..47
lib/sportradar/api/football/game_stats.rb on lines 49..54
lib/sportradar/api/football/game_stats.rb on lines 77..82
lib/sportradar/api/football/game_stats.rb on lines 84..89
lib/sportradar/api/football/game_stats.rb on lines 91..96
lib/sportradar/api/football/game_stats.rb on lines 105..110
lib/sportradar/api/football/game_stats.rb on lines 112..117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

          def api_key
            if !['t', 'sim'].include?(access_level) || (access_level == 'sim' && default_access_level == 'p')
              Sportradar::Api.api_key_params('ncaamb', 'production')
            else
              Sportradar::Api.api_key_params('ncaamb')
Severity: Minor
Found in lib/sportradar/api/basketball/ncaamb/api.rb and 4 other locations - About 15 mins to fix
lib/sportradar/api/basketball/nba/api.rb on lines 41..46
lib/sportradar/api/mma/api.rb on lines 39..44
lib/sportradar/api/odds/api.rb on lines 40..45
lib/sportradar/api/soccer/api.rb on lines 39..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

        def api_key
          if !['trial', 'sim'].include?(access_level) || (access_level == 'sim' && default_access_level == 'production')
            Sportradar::Api.api_key_params("odds", 'production')
          else
            Sportradar::Api.api_key_params("odds")
Severity: Minor
Found in lib/sportradar/api/odds/api.rb and 4 other locations - About 15 mins to fix
lib/sportradar/api/basketball/nba/api.rb on lines 41..46
lib/sportradar/api/basketball/ncaamb/api.rb on lines 41..46
lib/sportradar/api/mma/api.rb on lines 39..44
lib/sportradar/api/soccer/api.rb on lines 39..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

        def api_key
          if !['trial', 'sim'].include?(access_level) || (access_level == 'sim' && default_access_level == 'production')
            Sportradar::Api.api_key_params("soccer", 'production')
          else
            Sportradar::Api.api_key_params("soccer")
Severity: Minor
Found in lib/sportradar/api/soccer/api.rb and 4 other locations - About 15 mins to fix
lib/sportradar/api/basketball/nba/api.rb on lines 41..46
lib/sportradar/api/basketball/ncaamb/api.rb on lines 41..46
lib/sportradar/api/mma/api.rb on lines 39..44
lib/sportradar/api/odds/api.rb on lines 40..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

          def api_key
            if !['trial', 'sim'].include?(access_level) || (access_level == 'sim' && default_access_level == 'production')
              Sportradar::Api.api_key_params('nba', 'production')
            else
              Sportradar::Api.api_key_params('nba')
Severity: Minor
Found in lib/sportradar/api/basketball/nba/api.rb and 4 other locations - About 15 mins to fix
lib/sportradar/api/basketball/ncaamb/api.rb on lines 41..46
lib/sportradar/api/mma/api.rb on lines 39..44
lib/sportradar/api/odds/api.rb on lines 40..45
lib/sportradar/api/soccer/api.rb on lines 39..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

        def kickoffs
          @kickoffs ||= if response["kickoffs"]
            response["kickoffs"] = parse_out_hashes response["kickoffs"]
            Sportradar::Api::Football::StatPack::Kickoffs.new(response["kickoffs"])
          end
Severity: Major
Found in lib/sportradar/api/football/game_stats.rb and 7 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 42..47
lib/sportradar/api/football/game_stats.rb on lines 49..54
lib/sportradar/api/football/game_stats.rb on lines 77..82
lib/sportradar/api/football/game_stats.rb on lines 84..89
lib/sportradar/api/football/game_stats.rb on lines 105..110
lib/sportradar/api/football/game_stats.rb on lines 112..117
lib/sportradar/api/football/game_stats.rb on lines 133..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        def punt_returns
          @punt_returns ||= if (data = response["punt_returns"] || response["punt_return"])
            data = parse_out_hashes data
            Sportradar::Api::Football::StatPack::PuntReturns.new(data)
          end
Severity: Minor
Found in lib/sportradar/api/football/game_stats.rb and 5 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 56..61
lib/sportradar/api/football/game_stats.rb on lines 70..75
lib/sportradar/api/football/game_stats.rb on lines 98..103
lib/sportradar/api/football/game_stats.rb on lines 119..124
lib/sportradar/api/football/game_stats.rb on lines 126..131

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

          def self.new(data, **opts)
            existing = @all_hash[data['id']]
            if existing
              existing.update(data, **opts)
              existing
Severity: Minor
Found in lib/sportradar/api/basketball/nba/team.rb and 2 other locations - About 15 mins to fix
lib/sportradar/api/baseball/venue.rb on lines 7..14
lib/sportradar/api/basketball/venue.rb on lines 7..14

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

        def self.new(data, **opts)
          existing = @all_hash[data['id']]
          if existing
            existing.update(data, **opts)
            existing
Severity: Minor
Found in lib/sportradar/api/basketball/venue.rb and 2 other locations - About 15 mins to fix
lib/sportradar/api/baseball/venue.rb on lines 7..14
lib/sportradar/api/basketball/nba/team.rb on lines 9..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          @home         = Team.new(data['home'] || data.dig('scoring', 'home'), api: api, game: self) if data['home'] || data.dig('scoring', 'home')
          @away         = Team.new(data['away'] || data.dig('scoring', 'away'), api: api, game: self) if data['away'] || data.dig('scoring', 'away')
Severity: Minor
Found in lib/sportradar/api/baseball/game.rb and 1 other location - About 15 mins to fix
lib/sportradar/api/baseball/game.rb on lines 125..126

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        def extra_points
          @extra_points ||= if (data = response["extra_points"] || response["extra_point"])
            data = parse_out_hashes data
            Sportradar::Api::Football::StatPack::ExtraPoints.new(data)
          end
Severity: Minor
Found in lib/sportradar/api/football/game_stats.rb and 5 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 56..61
lib/sportradar/api/football/game_stats.rb on lines 63..68
lib/sportradar/api/football/game_stats.rb on lines 70..75
lib/sportradar/api/football/game_stats.rb on lines 98..103
lib/sportradar/api/football/game_stats.rb on lines 119..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        def field_goals
          @field_goals ||= if (data = response["field_goals"] || response["field_goal"])
            data = parse_out_hashes data
            Sportradar::Api::Football::StatPack::FieldGoals.new(data)
          end
Severity: Minor
Found in lib/sportradar/api/football/game_stats.rb and 5 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 56..61
lib/sportradar/api/football/game_stats.rb on lines 63..68
lib/sportradar/api/football/game_stats.rb on lines 70..75
lib/sportradar/api/football/game_stats.rb on lines 98..103
lib/sportradar/api/football/game_stats.rb on lines 126..131

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        def punts
          @punts ||= if (data = response["punts"] || response["punting"])
            data = parse_out_hashes data
            Sportradar::Api::Football::StatPack::Punts.new(data)
          end
Severity: Minor
Found in lib/sportradar/api/football/game_stats.rb and 5 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 63..68
lib/sportradar/api/football/game_stats.rb on lines 70..75
lib/sportradar/api/football/game_stats.rb on lines 98..103
lib/sportradar/api/football/game_stats.rb on lines 119..124
lib/sportradar/api/football/game_stats.rb on lines 126..131

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

        def kick_returns
          @kick_returns ||= if (data = response["kick_returns"] || response["kick_return"])
            data = parse_out_hashes data
            Sportradar::Api::Football::StatPack::KickReturns.new(data)
          end
Severity: Minor
Found in lib/sportradar/api/football/game_stats.rb and 5 other locations - About 15 mins to fix
lib/sportradar/api/football/game_stats.rb on lines 56..61
lib/sportradar/api/football/game_stats.rb on lines 63..68
lib/sportradar/api/football/game_stats.rb on lines 70..75
lib/sportradar/api/football/game_stats.rb on lines 119..124
lib/sportradar/api/football/game_stats.rb on lines 126..131

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language