jaroslavtyc/drd-plus-tables

View on GitHub
tests/Tables/Armaments/Armors/ArmorStrengthSanctionsTableTest.php

Summary

Maintainability
B
4 hrs
Test Coverage

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

    public function provideMissingStrengthAndResult()
    {
        $values = [];
        for ($missingStrength = -5; $missingStrength <= 0; $missingStrength++) {
            $values[] = [
Severity: Major
Found in tests/Tables/Armaments/Armors/ArmorStrengthSanctionsTableTest.php - About 2 hrs to fix

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

        public function I_can_get_all_values()
        {
            self::assertSame(
                [
                    0 => [
    Severity: Minor
    Found in tests/Tables/Armaments/Armors/ArmorStrengthSanctionsTableTest.php - About 1 hr to fix

      Function provideMissingStrengthAndResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function provideMissingStrengthAndResult()
          {
              $values = [];
              for ($missingStrength = -5; $missingStrength <= 0; $missingStrength++) {
                  $values[] = [
      Severity: Minor
      Found in tests/Tables/Armaments/Armors/ArmorStrengthSanctionsTableTest.php - About 25 mins 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 I_can_get_header is not named in camelCase.
      Open

          public function I_can_get_header()
          {
              $armorSanctionsTable = new ArmorStrengthSanctionsTable();
              self::assertSame(
                  [['missing_strength', 'sanction_description', 'agility_sanction', 'can_move']],

      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' => 10,

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

          public function I_can_not_get_agility_malus_if_unbearable()
          {
              $this->expectException(\DrdPlus\Tables\Armaments\Exceptions\CanNotUseArmorBecauseOfMissingStrength::class);
              $armorSanctionsTable = new ArmorStrengthSanctionsTable();
              self::assertSame(0, $armorSanctionsTable->getAgilityMalus(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_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)
          {
              $armorSanctionsTable = new ArmorStrengthSanctionsTable();
              self::assertSame(
                  $expectedValues,

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

          public function I_can_get_agility_malus()
          {
              $armorSanctionsTable = new ArmorStrengthSanctionsTable();
              self::assertSame(0, $armorSanctionsTable->getAgilityMalus(-10));
              self::assertSame(-8, $armorSanctionsTable->getAgilityMalus(7));

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

          public function I_can_find_out_if_can_move()
          {
              $armorSanctionsTable = new ArmorStrengthSanctionsTable();
              self::assertTrue($armorSanctionsTable->canMove(-10));
              self::assertTrue($armorSanctionsTable->canMove(10));

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

          public function I_can_get_sanction_description()
          {
              $armorSanctionsTable = new ArmorStrengthSanctionsTable();
              self::assertSame('light', $armorSanctionsTable->getSanctionDescription(-10));
              self::assertSame('extreme', $armorSanctionsTable->getSanctionDescription(10));

      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