jaroslavtyc/drd-plus-tables

View on GitHub
tests/Tables/TablesTest.php

Summary

Maintainability
C
1 day
Test Coverage

File TablesTest.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types = 1);

namespace DrdPlus\Tables;

use DrdPlus\Codes\Armaments\ArmamentCode;
Severity: Minor
Found in tests/Tables/TablesTest.php - About 3 hrs to fix

    TablesTest has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TablesTest extends TestWithMockery
    {
        /**
         * @test
         * @throws \ReflectionException
    Severity: Minor
    Found in tests/Tables/TablesTest.php - About 3 hrs to fix

      The class TablesTest has 27 non-getter- and setter-methods. Consider refactoring TablesTest to keep number of methods under 25.
      Open

      class TablesTest extends TestWithMockery
      {
          /**
           * @test
           * @throws \ReflectionException
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      TooManyMethods

      Since: 0.1

      A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      The default was changed from 10 to 25 in PHPMD 2.3.

      Example

      Source https://phpmd.org/rules/codesize.html#toomanymethods

      The class TablesTest has 23 public methods. Consider refactoring TablesTest to keep number of public methods under 10.
      Open

      class TablesTest extends TestWithMockery
      {
          /**
           * @test
           * @throws \ReflectionException
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      TooManyPublicMethods

      Since: 0.1

      A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      Example

      Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

      Function scanForTables has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          private function scanForTables(string $rootDir, string $rootNamespace): array
          {
              $tableClasses = [];
              foreach (\scandir($rootDir, SCANDIR_SORT_NONE) as $folder) {
                  $folderFullPath = $rootDir . DIRECTORY_SEPARATOR . $folder;
      Severity: Minor
      Found in tests/Tables/TablesTest.php - About 2 hrs 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

      The method scanForTables() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
      Open

          private function scanForTables(string $rootDir, string $rootNamespace): array
          {
              $tableClasses = [];
              foreach (\scandir($rootDir, SCANDIR_SORT_NONE) as $folder) {
                  $folderFullPath = $rootDir . DIRECTORY_SEPARATOR . $folder;
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

      The class TablesTest has a coupling between objects value of 42. Consider to reduce the number of dependencies under 13.
      Open

      class TablesTest extends TestWithMockery
      {
          /**
           * @test
           * @throws \ReflectionException
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      CouplingBetweenObjects

      Since: 1.1.0

      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

      Example

      class Foo {
          /**
           * @var \foo\bar\X
           */
          private $x = null;
      
          /**
           * @var \foo\bar\Y
           */
          private $y = null;
      
          /**
           * @var \foo\bar\Z
           */
          private $z = null;
      
          public function setFoo(\Foo $foo) {}
          public function setBar(\Bar $bar) {}
          public function setBaz(\Baz $baz) {}
      
          /**
           * @return \SplObjectStorage
           * @throws \OutOfRangeException
           * @throws \InvalidArgumentException
           * @throws \ErrorException
           */
          public function process(\Iterator $it) {}
      
          // ...
      }

      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

      Missing class import via use statement (line '169', column '32').
      Open

              $reflectionClass = new \ReflectionClass($class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '347', column '31').
      Open

              $codeReflection = new \ReflectionClass(RangedWeaponCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '45', column '32').
      Open

              $reflectionClass = new \ReflectionClass(Tables::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '108', column '44').
      Open

                          $reflectionClass = new \ReflectionClass($rootNamespace . '\\' . $matches['classBasename']);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '89', column '33').
      Open

              $tablesReflection = new \ReflectionClass(Tables::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Avoid using static access to class 'DrdPlus\Tables\Tables' in method 'I_can_get_any_table'.
      Open

              $tables = Tables::getIt();
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\BodyArmorCode' in method 'provideArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [BodyArmorCode::getIt(BodyArmorCode::HOBNAILED_ARMOR), ArmorStrengthSanctionsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\RangedWeaponCode' in method 'provideArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [RangedWeaponCode::getIt(RangedWeaponCode::HEAVY_CROSSBOW), RangedWeaponStrengthSanctionsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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 'provideArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [MeleeWeaponCode::getIt(MeleeWeaponCode::CLUB), MeleeWeaponStrengthSanctionsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\Tables\Tables' in method 'I_can_iterate_through_tables'.
      Open

              $tables = Tables::getIt();
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\ShieldCode' in method 'provideArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [ShieldCode::getIt(ShieldCode::BUCKLER), ShieldStrengthSanctionsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\HelmCode' in method 'provideArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [HelmCode::getIt(HelmCode::GREAT_HELM), ArmorStrengthSanctionsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\BodyArmorCode' in method 'provideProtectiveArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [BodyArmorCode::getIt(BodyArmorCode::HOBNAILED_ARMOR), ArmorWearingSkillTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\HelmCode' in method 'provideProtectiveArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [HelmCode::getIt(HelmCode::GREAT_HELM), ArmorWearingSkillTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\ShieldCode' in method 'provideProtectiveArmamentCodeAndExpectedSanctionsTable'.
      Open

                  [ShieldCode::getIt(ShieldCode::BUCKLER), ShieldUsageSkillTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\ShieldCode' in method 'provideProtectiveArmamentCodeAndExpectedRestrictionTable'.
      Open

                  [ShieldCode::getIt(ShieldCode::BUCKLER), ShieldsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\HelmCode' in method 'provideProtectiveArmamentCodeAndExpectedRestrictionTable'.
      Open

                  [HelmCode::getIt(HelmCode::GREAT_HELM), HelmsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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\BodyArmorCode' in method 'provideProtectiveArmamentCodeAndExpectedRestrictionTable'.
      Open

                  [BodyArmorCode::getIt(BodyArmorCode::HOBNAILED_ARMOR), BodyArmorsTable::class],
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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 excessively long variable names like $protectiveArmamentCode. Keep variable name length under 20.
      Open

              $protectiveArmamentCode = $this->mockery(ProtectiveArmamentCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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 $protectiveArmamentCode. Keep variable name length under 20.
      Open

              $protectiveArmamentCode = $this->mockery(ProtectiveArmamentCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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 $protectiveArmamentCode. Keep variable name length under 20.
      Open

              ProtectiveArmamentCode $protectiveArmamentCode,
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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 $protectiveArmamentCode. Keep variable name length under 20.
      Open

              ProtectiveArmamentCode $protectiveArmamentCode,
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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 $expectedTableTestClass. Keep variable name length under 20.
      Open

                  $expectedTableTestClass = str_replace('\Tables\\', '\Tests\Tables\\', $expectedTableClass) . 'Test';
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_armament_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_armament_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownArmament::class);
              /** @var ArmamentCode $armamentCode */
              $armamentCode = $this->mockery(ArmamentCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_melee_weaponlike_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_melee_weaponlike_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownMeleeWeaponlike::class);
              /** @var MeleeWeaponlikeCode $meleeWeaponlikeCode */
              $meleeWeaponlikeCode = $this->mockery(MeleeWeaponlikeCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_weaponlike_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_weaponlike_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownWeaponlike::class);
              /** @var WeaponlikeCode $weaponlikeCode */
              $weaponlikeCode = $this->mockery(WeaponlikeCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_sanctions_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_sanctions_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownArmament::class);
              /** @var ArmorCode $armamentCode */
              $armamentCode = $this->mockery(ArmamentCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_melee_weapons_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_melee_weapons_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownMeleeWeapon::class);
              $this->expectExceptionMessageMatches('~denigration~');
              /** @var MeleeWeaponCode $meleeWeaponCode */
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_table_any_restriction_table_for_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_table_any_restriction_table_for_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownProtectiveArmament::class);
              /** @var ProtectiveArmamentCode $protectiveArmamentCode */
              $protectiveArmamentCode = $this->mockery(ProtectiveArmamentCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_weaponlike_sanctions_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_weaponlike_sanctions_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownWeaponlike::class);
              /** @var WeaponlikeCode $weaponlikeCode */
              $weaponlikeCode = $this->mockery(WeaponlikeCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_range_weapons_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_range_weapons_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownRangedWeapon::class);
              $this->expectExceptionMessageMatches('~wallop~');
              /** @var RangedWeaponCode $rangeWeaponCode */
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_table_with_sanctions_by_missing_strength_for_every_armament is not named in camelCase.
      Open

          public function I_can_get_table_with_sanctions_by_missing_strength_for_every_armament(
              ArmamentCode $armamentCode,
              string $expectedTableClass
          ): void
          {
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_melee_weaponlike_sanctions_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_melee_weaponlike_sanctions_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownMeleeWeaponlike::class);
              /** @var MeleeWeaponlikeCode $meleeWeaponlikeCode */
              $meleeWeaponlikeCode = $this->mockery(MeleeWeaponlikeCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_table_with_restriction_for_every_protective_armament is not named in camelCase.
      Open

          public function I_can_get_table_with_restriction_for_every_protective_armament(
              ProtectiveArmamentCode $protectiveArmamentCode,
              string $expectedTableClass
          ): void
          {
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_any_table is not named in camelCase.
      Open

          public function I_can_get_any_table(): void
          {
              $reflectionClass = new \ReflectionClass(Tables::class);
              $tablesInstance = $reflectionClass->getProperty('tablesInstance');
              $tablesInstance->setAccessible(true);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_armament_table_by_armament_code is not named in camelCase.
      Open

          public function I_can_get_every_armament_table_by_armament_code(ArmamentCode $armamentCode, $expectedTableClass): void
          {
              self::assertInstanceOf($expectedTableClass, Tables::getIt()->getArmamentsTableByArmamentCode($armamentCode));
          }
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_iterate_through_tables is not named in camelCase.
      Open

          public function I_can_iterate_through_tables(): void
          {
              $tables = Tables::getIt();
              $fetchedTableClasses = [];
              foreach ($tables as $table) {
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_table_with_sanctions_by_missing_skill_for_every_protective_armament is not named in camelCase.
      Open

          public function I_can_get_table_with_sanctions_by_missing_skill_for_every_protective_armament(
              ProtectiveArmamentCode $protectiveArmamentCode,
              string $expectedTableClass
          ): void
          {
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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 Every_table_is_tested_by_default_test is not named in camelCase.
      Open

          public function Every_table_is_tested_by_default_test(): void
          {
              foreach ($this->getExpectedTableClasses() as $expectedTableClass) {
                  $expectedTableTestClass = str_replace('\Tables\\', '\Tests\Tables\\', $expectedTableClass) . 'Test';
                  self::assertTrue(class_exists($expectedTableTestClass), 'Missing test for table ' . $expectedTableClass);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_table_any_sanctions_by_missing_skill_table_for_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_table_any_sanctions_by_missing_skill_table_for_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownProtectiveArmament::class);
              /** @var ProtectiveArmamentCode $protectiveArmamentCode */
              $protectiveArmamentCode = $this->mockery(ProtectiveArmamentCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_projectiles_table_for_unknown_projectile is not named in camelCase.
      Open

          public function I_can_not_get_projectiles_table_for_unknown_projectile(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownProjectile::class);
              $this->expectExceptionMessageMatches('~foo~');
              $projectile = $this->mockery(ProjectileCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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_do_not_get_any_armors_table_by_unknown_code is not named in camelCase.
      Open

          public function I_do_not_get_any_armors_table_by_unknown_code(): void
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\UnknownArmor::class);
              /** @var ArmorCode $armorCode */
              $armorCode = $this->mockery(ArmorCode::class);
      Severity: Minor
      Found in tests/Tables/TablesTest.php by phpmd

      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