nabeelamjad/poke-api

View on GitHub
lib/poke-api/pogoprotos/pogoprotos_enums.rb

Summary

Maintainability
C
1 day
Test Coverage

Block has too many lines. [610/25]
Open

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_enum "POGOProtos.Enums.TutorialState" do
    value :LEGAL_SCREEN, 0
    value :AVATAR_SELECTION, 1
    value :ACCOUNT_CREATION, 2

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [180/25]
Open

  add_enum "POGOProtos.Enums.PokemonMove" do
    value :MOVE_UNSET, 0
    value :THUNDER_SHOCK, 1
    value :QUICK_ATTACK, 2
    value :SCRATCH, 3

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

File pogoprotos_enums.rb has 634 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'google/protobuf'

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_enum "POGOProtos.Enums.TutorialState" do
    value :LEGAL_SCREEN, 0
Severity: Major
Found in lib/poke-api/pogoprotos/pogoprotos_enums.rb - About 1 day to fix

    Block has too many lines. [152/25]
    Open

      add_enum "POGOProtos.Enums.PokemonId" do
        value :MISSINGNO, 0
        value :BULBASAUR, 1
        value :IVYSAUR, 2
        value :VENUSAUR, 3

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [81/25]
    Open

      add_enum "POGOProtos.Enums.PokemonFamilyId" do
        value :FAMILY_UNSET, 0
        value :FAMILY_BULBASAUR, 1
        value :FAMILY_CHARMANDER, 4
        value :FAMILY_SQUIRTLE, 7

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [38/25]
    Open

      add_enum "POGOProtos.Enums.BadgeType" do
        value :BADGE_UNSET, 0
        value :BADGE_TRAVEL_KM, 1
        value :BADGE_POKEDEX_ENTRIES, 2
        value :BADGE_CAPTURE_TOTAL, 3

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

      add_enum "POGOProtos.Enums.CameraTarget" do
        value :CAM_TARGET_ATTACKER, 0
        value :CAM_TARGET_ATTACKER_EDGE, 1
        value :CAM_TARGET_ATTACKER_GROUND, 2
        value :CAM_TARGET_DEFENDER, 3
    Severity: Minor
    Found in lib/poke-api/pogoprotos/pogoprotos_enums.rb and 1 other location - About 55 mins to fix
    lib/poke-api/pogoprotos/pogoprotos_networking_responses.rb on lines 206..220

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

    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