jaroslavtyc/drd-plus-profession-levels

View on GitHub
tests/Person/ProfessionLevels/AbstractTestOfProfessionLevel.php

Summary

Maintainability
A
1 hr
Test Coverage

Avoid too many return statements within this method.
Open

                return [PropertyCode::WILL, PropertyCode::CHARISMA];
Severity: Major
Found in tests/Person/ProfessionLevels/AbstractTestOfProfessionLevel.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return [PropertyCode::INTELLIGENCE, PropertyCode::CHARISMA];
    Severity: Major
    Found in tests/Person/ProfessionLevels/AbstractTestOfProfessionLevel.php - About 30 mins to fix

      Missing class import via use statement (line '58', column '19').
      Open

              throw new \LogicException('Unknown profession code ' . ValueDescriber::describe($professionCode));

      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 '27').
      Open

              $reflection = new \ReflectionClass(Profession::class);

      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 '\Mockery' in method 'createProfession'.
      Open

              $profession = \Mockery::mock($this->getProfessionClass($professionCode));

      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\Tools\ValueDescriber' in method 'getPrimaryProperties'.
      Open

              throw new \LogicException('Unknown profession code ' . ValueDescriber::describe($professionCode));

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

          abstract public function I_can_get_level_details(string $professionCode);

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

          abstract public function I_can_create_it(string $professionCode);

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

          abstract public function I_can_create_it_with_default_level_up_at();

      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