jaroslavtyc/drd-plus-codes

View on GitHub
Codes/Wizard/SpellCode.php

Summary

Maintainability
F
1 wk
Test Coverage

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

    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

      Method getEnergeticSpellCodes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getEnergeticSpellCodes(): array
          {
              return [
                  self::MAROON,
                  self::BURN,
      Severity: Minor
      Found in Codes/Wizard/SpellCode.php - About 1 hr to fix

        Method getMaterialSpellCodes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getMaterialSpellCodes(): array
            {
                return [
                    self::NOT_EVEN_HIT,
                    self::TODAY_YOU_WILL_TRY_IT_WITHOUT_WEAPON,
        Severity: Minor
        Found in Codes/Wizard/SpellCode.php - About 1 hr to fix

          Method getInvestigativeSpellCodes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getInvestigativeSpellCodes(): array
              {
                  return [
                      self::GOOD_TABLE,
                      self::WHERE_IS_MY_PIPE,
          Severity: Minor
          Found in Codes/Wizard/SpellCode.php - About 1 hr to fix

            Method getMentalSpellCodes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getMentalSpellCodes(): array
                {
                    return [
                        self::COLORS_AND_SHAPES,
                        self::ENJOY_YOURSELF,
            Severity: Minor
            Found in Codes/Wizard/SpellCode.php - About 1 hr to fix

              Method getTimeSpaceSpellCodes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getTimeSpaceSpellCodes(): array
                  {
                      return [
                          self::MAGIC_ARMOR,
                          self::PROJECTILE,
              Severity: Minor
              Found in Codes/Wizard/SpellCode.php - About 1 hr to fix

                Method getVitalSpellCodes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getVitalSpellCodes(): array
                    {
                        return [
                            self::QUINT_OF_SENSES,
                            self::TORTURE,
                Severity: Minor
                Found in Codes/Wizard/SpellCode.php - About 1 hr to fix

                  The class SpellCode has 1062 lines of code. Current threshold is 1000. Avoid really long classes.
                  Open

                  class SpellCode extends TranslatableCode
                  {
                      // TIME-SPACE
                      public const MAGIC_ARMOR = 'magic_armor';
                      public const PROJECTILE = 'projectile';
                  Severity: Minor
                  Found in Codes/Wizard/SpellCode.php by phpmd

                  The method fetchTranslations() has 501 lines of code. Current threshold is set to 100. Avoid really long methods.
                  Open

                      protected function fetchTranslations(): array
                      {
                          return [
                              'en' => [
                                  // TIME-SPACE
                  Severity: Minor
                  Found in Codes/Wizard/SpellCode.php by phpmd

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

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

                      public static function getEnergeticSpellCodes(): array
                      {
                          return [
                              self::MAROON,
                              self::BURN,
                  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 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

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

                      public static function getMentalSpellCodes(): array
                      {
                          return [
                              self::COLORS_AND_SHAPES,
                              self::ENJOY_YOURSELF,
                  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 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 getMaterialSpellCodes(): array
                      {
                          return [
                              self::NOT_EVEN_HIT,
                              self::TODAY_YOU_WILL_TRY_IT_WITHOUT_WEAPON,
                  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 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

                  There are no issues that match your filters.

                  Category
                  Status