jaroslavtyc/drd-plus-codes

View on GitHub

Showing 591 of 591 total issues

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

            'en' => [
                self::LIGHT_AXE => [self::$ONE => 'light axe', self::$FEW => 'light axes', self::$MANY => 'light axes'],
                self::AXE => [self::$ONE => 'axe', self::$FEW => 'axes', self::$MANY => 'axes'],
                self::WAR_AXE => [self::$ONE => 'war axe', self::$FEW => 'war axes', self::$MANY => 'war axes'],
                self::TWO_HANDED_AXE => [self::$ONE => 'two handed axe', self::$FEW => 'two handed axes', self::$MANY => 'two handed axes'],
Severity: Major
Found in Codes/Armaments/MeleeWeaponCode.php and 1 other location - About 1 wk to fix
Codes/Armaments/MeleeWeaponCode.php on lines 529..587

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

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

            'cs' => [
                self::LIGHT_AXE => [self::$ONE => 'lehká sekerka', self::$FEW => 'lehké sekerky', self::$MANY => 'lehkých sekerek'],
                self::AXE => [self::$ONE => 'sekera', self::$FEW => 'sekery', self::$MANY => 'seker'],
                self::WAR_AXE => [self::$ONE => 'válečná sekera', self::$FEW => 'válečné sekery', self::$MANY => 'válečných seker'],
                self::TWO_HANDED_AXE => [self::$ONE => 'obouruční sekera', self::$FEW => 'obouruční sekery', self::$MANY => 'obouručních seker'],
Severity: Major
Found in Codes/Armaments/MeleeWeaponCode.php and 1 other location - About 1 wk to fix
Codes/Armaments/MeleeWeaponCode.php on lines 470..528

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

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

            'en' => [
                self::STRENGTH => [self::$ONE => 'strength', self::$FEW => 'strengths', self::$MANY => 'strengths'],
                self::AGILITY => [self::$ONE => 'agility', self::$FEW => 'agilities', self::$MANY => 'agilities'],
                self::KNACK => [self::$ONE => 'knack', self::$FEW => 'knacks', self::$MANY => 'knacks'],
                self::WILL => [self::$ONE => 'will', self::$FEW => 'wills', self::$MANY => 'wills'],
Severity: Major
Found in Codes/Properties/PropertyCode.php and 1 other location - About 5 days to fix
Codes/Properties/PropertyCode.php on lines 188..221

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

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

            'cs' => [
                self::STRENGTH => [self::$ONE => 'síla', self::$FEW => 'síly', self::$MANY => 'sil'],
                self::AGILITY => [self::$ONE => 'obratnost', self::$FEW => 'obratnosti', self::$MANY => 'obratností'],
                self::KNACK => [self::$ONE => 'zručnost', self::$FEW => 'zručnosti', self::$MANY => 'zručností'],
                self::WILL => [self::$ONE => 'vůle', self::$FEW => 'vůle', self::$MANY => 'vůlí'],
Severity: Major
Found in Codes/Properties/PropertyCode.php and 1 other location - About 5 days to fix
Codes/Properties/PropertyCode.php on lines 154..187

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

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

            'en' => [
                self::SHORT_BOW => [self::$ONE => 'short bow', self::$FEW => 'short bows', self::$MANY => 'short bows'],
                self::LONG_BOW => [self::$ONE => 'long bow', self::$FEW => 'long bows', self::$MANY => 'long bows'],
                self::SHORT_COMPOSITE_BOW => [self::$ONE => 'short composite bow', self::$FEW => 'short composite bows', self::$MANY => 'short composite bows'],
                self::LONG_COMPOSITE_BOW => [self::$ONE => 'long composite bow', self::$FEW => 'long composite bows', self::$MANY => 'long composite bows'],
Severity: Major
Found in Codes/Armaments/RangedWeaponCode.php and 1 other location - About 3 days to fix
Codes/Armaments/RangedWeaponCode.php on lines 260..280

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

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

            'cs' => [
                self::SHORT_BOW => [self::$ONE => 'krátký luk', self::$FEW => 'krátké luky', self::$MANY => 'krátkých luků'],
                self::LONG_BOW => [self::$ONE => 'dlouhý luk', self::$FEW => 'dlouhé luky', self::$MANY => 'dlouhých luků'],
                self::SHORT_COMPOSITE_BOW => [self::$ONE => 'krátký skládaný luk', self::$FEW => 'krátké skládané luky', self::$MANY => 'krátkých skládaných luků'],
                self::LONG_COMPOSITE_BOW => [self::$ONE => 'dlouhý skládaný luk', self::$FEW => 'dlouhé skládané luky', self::$MANY => 'dlouhých skládaných luků'],
Severity: Major
Found in Codes/Armaments/RangedWeaponCode.php and 1 other location - About 3 days to fix
Codes/Armaments/RangedWeaponCode.php on lines 239..259

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

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

File SpellCode.php has 1016 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

namespace DrdPlus\Codes\Wizard;

use DrdPlus\Codes\Partials\TranslatableCode;
Severity: Major
Found in Codes/Wizard/SpellCode.php - About 2 days to fix

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

                'en' => [
                    self::HORSE => [self::$ONE => 'horse', self::$FEW => 'horses', self::$MANY => 'horses'],
                    self::DRAFT_HORSE => [self::$ONE => 'draft horse', self::$FEW => 'draft horses', self::$MANY => 'draft horses'],
                    self::RIDING_HORSE => [self::$ONE => 'riding horse', self::$FEW => 'riding horses', self::$MANY => 'riding horses'],
                    self::WAR_HORSE => [self::$ONE => 'war horse', self::$FEW => 'war horses', self::$MANY => 'war horses'],
    Severity: Major
    Found in Codes/Transport/RidingAnimalCode.php and 1 other location - About 2 days to fix
    Codes/Transport/RidingAnimalCode.php on lines 86..102

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

    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

                'cs' => [
                    self::HORSE => [self::$ONE => 'kůň', self::$FEW => 'koně', self::$MANY => 'koní'],
                    self::DRAFT_HORSE => [self::$ONE => 'tažný kůň', self::$FEW => 'tažné koně', self::$MANY => 'tažných koní'],
                    self::RIDING_HORSE => [self::$ONE => 'jezdecký kůň', self::$FEW => 'jezdečtí koně', self::$MANY => 'jezdeckých koní'],
                    self::WAR_HORSE => [self::$ONE => 'válečný kůň', self::$FEW => 'válečné koně', self::$MANY => 'válečných koní'],
    Severity: Major
    Found in Codes/Transport/RidingAnimalCode.php and 1 other location - About 2 days to fix
    Codes/Transport/RidingAnimalCode.php on lines 69..85

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

    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

    Method fetchTranslations has 486 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function fetchTranslations(): array
        {
            return [
                'en' => [
                    // TIME-SPACE
    Severity: Major
    Found in Codes/Wizard/SpellCode.php - About 2 days to fix

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

                  'cs' => [
                      self::ARMOR_WEARING => [self::$ONE => 'nošení zbroje'],
                      self::ATHLETICS => [self::$ONE => 'atletika'],
                      self::BLACKSMITHING => [self::$ONE => 'kovářství'],
                      self::BOAT_DRIVING => [self::$ONE => 'ovládání loďky'],
      Severity: Major
      Found in Codes/Skills/PhysicalSkillCode.php and 1 other location - About 2 days to fix
      Codes/Skills/PhysicalSkillCode.php on lines 79..107

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

      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

                  'en' => [
                      self::ARMOR_WEARING => [self::$ONE => 'armor wearing'],
                      self::ATHLETICS => [self::$ONE => 'athletics'],
                      self::BLACKSMITHING => [self::$ONE => 'blacksmithing'],
                      self::BOAT_DRIVING => [self::$ONE => 'boat driving'],
      Severity: Major
      Found in Codes/Skills/PhysicalSkillCode.php and 1 other location - About 2 days to fix
      Codes/Skills/PhysicalSkillCode.php on lines 108..136

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

      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

                  'cs' => [
                      self::BIG_HANDWORK => [self::$ONE => 'velké ruční práce'],
                      self::COOKING => [self::$ONE => 'vaření'],
                      self::DANCING => [self::$ONE => 'tanec'],
                      self::DUSK_SIGHT => [self::$ONE => 'šerozrakost'],
      Severity: Major
      Found in Codes/Skills/CombinedSkillCode.php and 1 other location - About 1 day to fix
      Codes/Skills/CombinedSkillCode.php on lines 67..89

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

      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

                  'en' => [
                      self::BIG_HANDWORK => [self::$ONE => 'big handwork'],
                      self::COOKING => [self::$ONE => 'cooking'],
                      self::DANCING => [self::$ONE => 'dancing'],
                      self::DUSK_SIGHT => [self::$ONE => 'dusk sight'],
      Severity: Major
      Found in Codes/Skills/CombinedSkillCode.php and 1 other location - About 1 day to fix
      Codes/Skills/CombinedSkillCode.php on lines 90..112

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

      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

                  'cs' => [
                      self::ASTRONOMY => [self::$ONE => 'astronomie'],
                      self::BOTANY => [self::$ONE => 'botanika'],
                      self::ETIQUETTE_OF_GANGLAND => [self::$ONE => 'etiketa podstvětí'],
                      self::FOREIGN_LANGUAGE => [self::$ONE => 'cizí jazyk'],
      Severity: Major
      Found in Codes/Skills/PsychicalSkillCode.php and 1 other location - About 1 day to fix
      Codes/Skills/PsychicalSkillCode.php on lines 58..75

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

      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

                  'en' => [
                      self::ASTRONOMY => [self::$ONE => 'astronomy'],
                      self::BOTANY => [self::$ONE => 'botany'],
                      self::ETIQUETTE_OF_GANGLAND => [self::$ONE => 'etiquette of gangland'],
                      self::FOREIGN_LANGUAGE => [self::$ONE => 'foreign language'],
      Severity: Major
      Found in Codes/Skills/PsychicalSkillCode.php and 1 other location - About 1 day to fix
      Codes/Skills/PsychicalSkillCode.php on lines 76..93

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

      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

      Function I_can_ask_code_if_is_specific_weapon_type has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          public function I_can_ask_code_if_is_specific_weapon_type()
          {
              $questions = [
                  'isAxe', 'isKnifeOrDagger', 'isMaceOrClub', 'isMorningstarOrMorgenstern', 'isSaberOrBowieKnife',
                  'isStaffOrSpear', 'isSword', 'isVoulgeOrTrident', 'isUnarmed',
      Severity: Minor
      Found in tests/Codes/Armaments/MeleeWeaponCodeTest.php - About 1 day 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

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

          public static function getInvestigativeSpellCodes(): array
          {
              return [
                  self::GOOD_TABLE,
                  self::WHERE_IS_MY_PIPE,
      Severity: Major
      Found in Codes/Wizard/SpellCode.php and 5 other locations - About 1 day to fix
      Codes/Wizard/SpellCode.php on lines 58..102
      Codes/Wizard/SpellCode.php on lines 149..193
      Codes/Wizard/SpellCode.php on lines 240..284
      Codes/Wizard/SpellCode.php on lines 421..465
      Codes/Wizard/SpellCode.php on lines 512..556

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

      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

          public static function getVitalSpellCodes(): array
          {
              return [
                  self::QUINT_OF_SENSES,
                  self::TORTURE,
      Severity: Major
      Found in Codes/Wizard/SpellCode.php and 5 other locations - About 1 day to fix
      Codes/Wizard/SpellCode.php on lines 58..102
      Codes/Wizard/SpellCode.php on lines 149..193
      Codes/Wizard/SpellCode.php on lines 240..284
      Codes/Wizard/SpellCode.php on lines 331..375
      Codes/Wizard/SpellCode.php on lines 421..465

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

      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

          public static function getTimeSpaceSpellCodes(): array
          {
              return [
                  self::MAGIC_ARMOR,
                  self::PROJECTILE,
      Severity: Major
      Found in Codes/Wizard/SpellCode.php and 5 other locations - About 1 day to fix
      Codes/Wizard/SpellCode.php on lines 149..193
      Codes/Wizard/SpellCode.php on lines 240..284
      Codes/Wizard/SpellCode.php on lines 331..375
      Codes/Wizard/SpellCode.php on lines 421..465
      Codes/Wizard/SpellCode.php on lines 512..556

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

      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