jaroslavtyc/drd-plus-tables

View on GitHub
tests/Tables/Armaments/Partials/AbstractMeleeWeaponlikeStrengthSanctionsTableTest.php

Summary

Maintainability
B
5 hrs
Test Coverage

Method I_can_get_all_values has 101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function I_can_get_all_values()
    {
        self::assertSame(
            [
                0 => [

    Method provideMissingStrengthAndResult has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function provideMissingStrengthAndResult()
        {
            $values = [];
            for ($missingStrength = -5; $missingStrength <= 0; $missingStrength++) {
                $values[] = [

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

          public function I_can_get_all_values()
          {
              self::assertSame(
                  [
                      0 => [

      Avoid excessively long class names like AbstractMeleeWeaponlikeStrengthSanctionsTableTest. Keep class name length under 40.
      Open

      abstract class AbstractMeleeWeaponlikeStrengthSanctionsTableTest extends AbstractStrengthSanctionsTableTest
      {
          /**
           * @test
           */

      LongClassName

      Since: 2.9

      Detects when classes or interfaces are declared with excessively long names.

      Example

      class ATooLongClassNameThatHintsAtADesignProblem {
      
      }
      
      interface ATooLongInterfaceNameThatHintsAtADesignProblem {
      
      }

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

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

              $meleeWeaponSanctionsTable = new MeleeWeaponStrengthSanctionsTable();

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

          public function I_can_get_sanction_data_for_any_strength_missing($missingStrength, array $expectedValues)
          {
              self::assertSame(
                  $expectedValues,
                  (new MeleeWeaponStrengthSanctionsTable())->getSanctionsForMissingStrength($missingStrength),

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

          public function I_can_not_get_any_sanction_for_too_much_missing_strength($sanctionName)
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Weapons\Exceptions\CanNotUseWeaponBecauseOfMissingStrength::class);
              $sanctionGetter = 'get' . ucfirst($sanctionName) . 'Sanction';
              (new MeleeWeaponStrengthSanctionsTable())->$sanctionGetter(11);

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

          public function I_can_get_all_values()
          {
              self::assertSame(
                  [
                      0 => [

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

          public function I_get_always_zero_for_every_sanction_if_no_missing_strength($sanctionName)
          {
              $sanctionGetter = 'get' . ucfirst($sanctionName) . 'Sanction';
              $meleeWeaponSanctionsTable = new MeleeWeaponStrengthSanctionsTable();
              self::assertSame(0, $meleeWeaponSanctionsTable->$sanctionGetter(0));

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

          public function I_can_get_sanctions_for_missing_strength()
          {
              self::assertSame(
                  [
                      'missing_strength' => 2,

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

          public function I_can_get_header()
          {
              self::assertSame(
                  [['missing_strength', 'fight_number', 'attack_number', 'defense_number', 'base_of_wounds', 'can_use_armament']],
                  (new MeleeWeaponStrengthSanctionsTable())->getHeader()

      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