mhuggins/lol_client

View on GitHub
lib/lol_client.rb

Summary

Maintainability
D
1 day
Test Coverage

Class LolClient has 27 methods (exceeds 20 allowed). Consider refactoring.
Open

class LolClient
  REGIONS = [:br, :eune, :euw, :kr, :lan, :las, :na, :oce, :ru, :tr].to_set.freeze

  CHALLENGER_LEAGUE_TYPES = [:RANKED_SOLO_5x5, :RANKED_TEAM_3x3, :RANKED_TEAM_5x5].to_set.freeze

Severity: Minor
Found in lib/lol_client.rb - About 3 hrs to fix

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

      def static_rune(rune_id, locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_RUNE_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, runeData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 4 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 252..259
    lib/lol_client.rb on lines 296..303
    lib/lol_client.rb on lines 340..347
    lib/lol_client.rb on lines 428..435

    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 53.

    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 static_spell(spell_id, locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_SPELL_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, spellData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 4 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 252..259
    lib/lol_client.rb on lines 296..303
    lib/lol_client.rb on lines 340..347
    lib/lol_client.rb on lines 384..391

    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 53.

    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 static_champion(champion_id, locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_CHAMPION_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, champData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 4 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 296..303
    lib/lol_client.rb on lines 340..347
    lib/lol_client.rb on lines 384..391
    lib/lol_client.rb on lines 428..435

    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 53.

    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 static_item(item_id, locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_ITEM_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, itemData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 4 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 252..259
    lib/lol_client.rb on lines 340..347
    lib/lol_client.rb on lines 384..391
    lib/lol_client.rb on lines 428..435

    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 53.

    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 static_mastery(mastery_id, locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_MASTERY_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, masteryData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 4 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 252..259
    lib/lol_client.rb on lines 296..303
    lib/lol_client.rb on lines 384..391
    lib/lol_client.rb on lines 428..435

    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 53.

    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

      def static_items(locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_ITEM_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, itemListData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 1 other location - About 1 hr to fix
    lib/lol_client.rb on lines 362..369

    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 50.

    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

      def static_runes(locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_RUNE_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, runeListData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 1 other location - About 1 hr to fix
    lib/lol_client.rb on lines 274..281

    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 50.

    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 3 locations. Consider refactoring.
    Open

      def static_spells(locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_SPELL_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, spellData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 2 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 230..237
    lib/lol_client.rb on lines 318..325

    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 49.

    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 3 locations. Consider refactoring.
    Open

      def static_champions(locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_CHAMPION_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, champData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 2 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 318..325
    lib/lol_client.rb on lines 406..413

    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 49.

    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 3 locations. Consider refactoring.
    Open

      def static_masteries(locale: nil, version: nil, data: nil)
        data = array_options(data)
        data.each { |opt| raise ArgumentError, "invalid data option \"#{opt}\"" unless STATIC_MASTERY_DATA_OPTIONS.include?(opt) }
    
        params = params_for(locale: locale, version: version, masteryListData: data.join(','))
    Severity: Major
    Found in lib/lol_client.rb and 2 other locations - About 1 hr to fix
    lib/lol_client.rb on lines 230..237
    lib/lol_client.rb on lines 406..413

    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 49.

    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

    There are no issues that match your filters.

    Category
    Status