jaroslavtyc/drd-plus-therugist-spells

View on GitHub

Showing 142 of 142 total issues

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

            $getParameterWithAddition = StringTools::assembleGetterForName($parameterName . 'WithAddition');
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.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 $difficultyPerAdditionStep. Keep variable name length under 20.
Open

    private $difficultyPerAdditionStep;

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 class names like InvalidFormatOfAdditionByDifficultyNotation. Keep class name length under 40.
Open

class InvalidFormatOfAdditionByDifficultyNotation extends \InvalidArgumentException implements Logic
{

}

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

        $spellTraitsDifficultyChangeSum = 0;
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.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 $spellTraitsDifficultyChangeSum. Keep variable name length under 20.
Open

        $spellTraitsDifficultyChangeSum = 0;
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Modifier.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 $difficultyAdditionByRealmsNotation. Keep variable name length under 20.
Open

    public function __construct($difficultyAdditionByRealmsNotation, int $currentAddition = null)

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

        $spellSpeedWithAddition = $this->getSpellSpeedWithAddition();
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.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 $spellTraitTrapPropertyValue. Keep variable name length under 20.
Open

    private function sanitizeSpellTraitTrapPropertyChange(int $spellTraitTrapPropertyValue = null): int

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

        $epicenterShiftWithAddition = $this->getEpicenterShiftWithAddition();
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.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 $epicenterShiftByModifiers. Keep variable name length under 20.
Open

        $epicenterShiftByModifiers = $this->getParameterBonusFromModifiers(ModifierMutableSpellParameterCode::EPICENTER_SHIFT);
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.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 $baseNumberOfWaypoints. Keep variable name length under 20.
Open

        $baseNumberOfWaypoints = $this->getBaseNumberOfWaypoints();
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Modifier.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 $numberOfSituationsValue. Keep variable name length under 20.
Open

        $numberOfSituationsValue = $this->getValue($modifierCode, self::NUMBER_OF_SITUATIONS);

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

Method getCurrentDifficulty has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCurrentDifficulty(): FormulaDifficulty
    {
        $formulaParameters = [
            $this->getAttackWithAddition(),
            $this->getBrightnessWithAddition(),
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.php - About 1 hr to fix

    Method sanitizeSpellParameterChanges has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function sanitizeSpellParameterChanges(array $spellParameterValues): array
        {
            $sanitizedChanges = [];
            foreach (ModifierMutableSpellParameterCode::getPossibleValues() as $mutableSpellParameter) {
                if (!array_key_exists($mutableSpellParameter, $spellParameterValues)) {
    Severity: Minor
    Found in DrdPlus/Theurgist/Spells/Modifier.php - About 1 hr to fix

      Method sanitizeSpellParameterChanges has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function sanitizeSpellParameterChanges(array $spellParameterValues): array
          {
              $sanitizedChanges = [];
              foreach (FormulaMutableSpellParameterCode::getPossibleValues() as $mutableSpellParameter) {
                  if (!\array_key_exists($mutableSpellParameter, $spellParameterValues)) {
      Severity: Minor
      Found in DrdPlus/Theurgist/Spells/Formula.php - About 1 hr to fix

        Method getDifficultyChange has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getDifficultyChange(): DifficultyChange
            {
                $modifierParameters = [
                    $this->getAttackWithAddition(),
                    $this->getNumberOfConditionsWithAddition(),
        Severity: Minor
        Found in DrdPlus/Theurgist/Spells/Modifier.php - About 1 hr to fix

          Method getParameterBonusFromModifiers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getParameterBonusFromModifiers(string $parameterName)
              {
                  $bonusParts = [];
                  foreach ($this->modifiers as $modifier) {
                      if ($modifier->getModifierCode()->getValue() === ModifierCode::GATE) {
          Severity: Minor
          Found in DrdPlus/Theurgist/Spells/Formula.php - About 1 hr to fix

            The class Modifier has 49 public methods and attributes. Consider reducing the number of public items to less than 45.
            Open

            class Modifier extends StrictObject
            {
                use ToFlatArrayTrait;
            
                /** @var ModifierCode */
            Severity: Minor
            Found in DrdPlus/Theurgist/Spells/Modifier.php by phpmd

            ExcessivePublicCount

            Since: 0.1

            A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

            Example

            public class Foo {
                public $value;
                public $something;
                public $var;
                // [... more more public attributes ...]
            
                public function doWork() {}
                public function doMoreWork() {}
                public function doWorkAgain() {}
                // [... more more public methods ...]
            }

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

            Method __construct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function __construct(array $values)
                {
                    try {
                        $this->minimal = ToInteger::toPositiveInteger($values[0] ?? null);
                    } catch (\Granam\Integer\Tools\Exceptions\Exception $exception) {
            Severity: Minor
            Found in DrdPlus/Theurgist/Spells/SpellParameters/FormulaDifficulty.php - About 1 hr to fix

              Method getExpectedDataHeaderNamesToTypes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getExpectedDataHeaderNamesToTypes(): array
                  {
                      return [
                          self::REALM => self::POSITIVE_INTEGER,
                          self::REALMS_AFFECTION => self::ARRAY,
              Severity: Minor
              Found in DrdPlus/Theurgist/Spells/ModifiersTable.php - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language