jaroslavtyc/drd-plus-tables

View on GitHub
tests/Tables/Armaments/Weapons/Melee/Partials/MeleeWeaponsTableTest.php

Summary

Maintainability
B
4 hrs
Test Coverage

Method I_can_not_add_same_named_weapon_with_different_parameters has 16 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $templateRequiredStrength,
        $templateWeaponLength,
        $templateOffensiveness,
        $templateWounds,
        $templatePhysicalWoundTypeCode,

    Method I_can_add_same_weapon_multiple_time_without_error has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function I_can_add_same_weapon_multiple_time_without_error()
        {
            $sut = $this->createSut();
            $name = uniqid('cleaver', true);
            MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      The method I_can_not_add_same_named_weapon_with_different_parameters has 16 parameters. Consider reducing the number of parameters to less than 10.
      Open

          public function I_can_not_add_same_named_weapon_with_different_parameters(
              $templateRequiredStrength,
              $templateWeaponLength,
              $templateOffensiveness,
              $templateWounds,

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_not_add_same_named_weapon_with_different_parameters'.
      Open

              $spoon = MeleeWeaponCode::getIt($name);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Body\PhysicalWoundTypeCode' in method 'provideNewWeaponSlightlyChangedParameters'.
      Open

                  'woundTypeCode' => PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CUT),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\BaseProperties\Strength' in method 'I_can_not_add_same_named_weapon_with_different_parameters'.
      Open

                  Strength::getIt($templateRequiredStrength),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\BaseProperties\Strength' in method 'I_can_not_add_same_named_weapon_with_different_parameters'.
      Open

              $addedAgain = $sut->$addNew($spoon, Strength::getIt($requiredStrength), $weaponLength, $offensiveness, $wounds, $woundTypeCode, $cover, $weight, $twoHandedOnly);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_add_new_melee_weapon'.
      Open

              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\BaseProperties\Strength' in method 'I_can_add_new_melee_weapon'.
      Open

                  $requiredStrength = Strength::getIt(0),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\WeaponCategoryCode' in method 'getMeleeWeaponCategory'.
      Open

                  $this->meleeWeaponCategory = WeaponCategoryCode::getIt($categoryName);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Body\PhysicalWoundTypeCode' in method 'I_can_add_new_melee_weapon_by_specific_method'.
      Open

                  $woundTypeCode = PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CUT),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Body\PhysicalWoundTypeCode' in method 'I_can_add_new_melee_weapon'.
      Open

                  $woundTypeCode = PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CUT),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_add_new_melee_weapon_by_specific_method'.
      Open

              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\BaseProperties\Strength' in method 'I_can_add_same_weapon_multiple_time_without_error'.
      Open

              $requiredStrength = Strength::getIt(0);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_add_new_melee_weapon'.
      Open

              $chopa = MeleeWeaponCode::getIt($name);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_add_same_weapon_multiple_time_without_error'.
      Open

              $cleaver = MeleeWeaponCode::getIt($name);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_add_same_weapon_multiple_time_without_error'.
      Open

              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Body\PhysicalWoundTypeCode' in method 'I_can_add_same_weapon_multiple_time_without_error'.
      Open

                      $woundTypeCode = PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CUT),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Body\PhysicalWoundTypeCode' in method 'I_can_add_same_weapon_multiple_time_without_error'.
      Open

              $woundTypeCode = PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CUT);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\Granam\String\StringTools' in method 'getMeleeWeaponCategory'.
      Open

                  $categoryName = StringTools::camelCaseToSnakeCasedBasename($keyword);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      The method I_can_add_same_weapon_multiple_time_without_error uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      self::assertFalse($added);
                  }

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_not_add_same_named_weapon_with_different_parameters'.
      Open

              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_add_new_melee_weapon_by_specific_method'.
      Open

              $crasher = MeleeWeaponCode::getIt($name);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Body\PhysicalWoundTypeCode' in method 'provideNewWeaponSlightlyChangedParameters'.
      Open

                  array_merge($templateValues, array_values(array_merge($template, ['woundTypeCode' => PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CRUSH)]))),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\BaseProperties\Strength' in method 'I_can_add_new_melee_weapon_by_specific_method'.
      Open

                  $requiredStrength = Strength::getIt(10),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\BaseProperties\Strength' in method 'I_can_not_add_new_melee_weapon_with_unexpected_category'.
      Open

                  $requiredStrength = Strength::getIt(0),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_not_add_new_melee_weapon_with_unexpected_category'.
      Open

              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Body\PhysicalWoundTypeCode' in method 'I_can_not_add_new_melee_weapon_with_unexpected_category'.
      Open

                  $woundTypeCode = PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CUT),

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\WeaponCategoryCode' in method 'I_can_not_add_new_melee_weapon_with_unexpected_category'.
      Open

                  WeaponCategoryCode::getIt(WeaponCategoryCode::CROSSBOWS), // intentionally ranged

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\DrdPlus\Codes\Armaments\MeleeWeaponCode' in method 'I_can_not_add_new_melee_weapon_with_unexpected_category'.
      Open

              $hamAndAxe = MeleeWeaponCode::getIt($name);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid unused local variables such as '$weaponLength'.
      Open

                  $weaponLength = 1,

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$woundTypeCode'.
      Open

                  $woundTypeCode = PhysicalWoundTypeCode::getIt(PhysicalWoundTypeCode::CUT),

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$twoHandedOnly'.
      Open

                  $twoHandedOnly = false

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$requiredStrength'.
      Open

                  $requiredStrength = Strength::getIt(0),

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$cover'.
      Open

                  $cover = 4,

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$offensiveness'.
      Open

                  $offensiveness = 2,

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$weight'.
      Open

                  $weight = new Weight(5, Weight::KG, Tables::getIt()->getWeightTable()),

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$wounds'.
      Open

                  $wounds = 3,

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

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

          private function getMeleeWeaponCategory(): WeaponCategoryCode
          {
              if ($this->meleeWeaponCategory === null) {
                  $sutClass = static::getSutClass();
                  $basename = preg_replace('~^.+\\\([^\\\]+)$~', '$1', $sutClass);
      tests/Tables/Armaments/Partials/WeaponlikeTableTest.php on lines 26..38

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

      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

      Avoid excessively long variable names like $templatePhysicalWoundTypeCode. Keep variable name length under 20.
      Open

              $templatePhysicalWoundTypeCode,

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      Avoid excessively long variable names like $templateRequiredStrength. Keep variable name length under 20.
      Open

              $templateRequiredStrength,

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      Avoid excessively long variable names like $templateOffensiveness. Keep variable name length under 20.
      Open

              $templateOffensiveness,

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      Avoid excessively long variable names like $templateTwoHandedOnly. Keep variable name length under 20.
      Open

              $templateTwoHandedOnly,

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      The method I_can_get_header is not named in camelCase.
      Open

          public function I_can_get_header()
          {
              $meleeWeaponsTable = $this->createSut();
              self::assertSame(
                  [['weapon', 'required_strength', 'length', 'offensiveness', 'wounds', 'wounds_type', 'cover', 'weight', 'two_handed_only']],

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method I_can_get_every_weapon_by_weapon_codes_library is not named in camelCase.
      Open

          abstract public function I_can_get_every_weapon_by_weapon_codes_library();

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method I_can_not_get_value_of_unknown_melee_weapon is not named in camelCase.
      Open

          public function I_can_not_get_value_of_unknown_melee_weapon($valueName)
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownMeleeWeapon::class);
              $this->expectExceptionMessageMatches('~skull_crasher~');
              $getValueNameOf = $this->assembleValueGetter($valueName);

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method I_can_not_add_same_named_weapon_with_different_parameters is not named in camelCase.
      Open

          public function I_can_not_add_same_named_weapon_with_different_parameters(
              $templateRequiredStrength,
              $templateWeaponLength,
              $templateOffensiveness,
              $templateWounds,

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method I_can_add_new_melee_weapon_by_specific_method is not named in camelCase.
      Open

          public function I_can_add_new_melee_weapon_by_specific_method()
          {
              $sut = $this->createSut();
              $name = uniqid('crasher', true);
              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method I_can_add_same_weapon_multiple_time_without_error is not named in camelCase.
      Open

          public function I_can_add_same_weapon_multiple_time_without_error()
          {
              $sut = $this->createSut();
              $name = uniqid('cleaver', true);
              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method I_can_add_new_melee_weapon is not named in camelCase.
      Open

          public function I_can_add_new_melee_weapon()
          {
              $sut = $this->createSut();
              $name = uniqid('chopa', true);
              MeleeWeaponCode::addNewMeleeWeaponCode($name, $this->getMeleeWeaponCategory(), []);

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method I_can_not_add_new_melee_weapon_with_unexpected_category is not named in camelCase.
      Open

          public function I_can_not_add_new_melee_weapon_with_unexpected_category()
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Weapons\Exceptions\NewWeaponIsNotOfRequiredType::class);
              $this->expectExceptionMessageMatches('~crossbow.+ham&axe~');
              $sut = $this->createSut();

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status