jaroslavtyc/drd-plus-therugist-spells

View on GitHub

Showing 142 of 142 total issues

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

private function parseParts(string $additionByDifficultyNotation): array

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

private $formulaDifficultyAddition;

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

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

foreach (ModifierMutableSpellParameterCode::getPossibleValues() as $mutableSpellParameter) {
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Modifier.php by phpmd

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

private $realmsChangePerAdditionStep;

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

public function createWithChange($difficultyChangeValue): FormulaDifficulty

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

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

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

private function parseParts(string $additionByRealmNotation): array

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

int $spellTraitTrapPropertyValue = null

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

$byModifierRequiredRealm = $modifier->getRequiredRealm();
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.php by phpmd

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

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

$modifiersDifficultyChangeSum = 0;
Severity: Minor
Found in DrdPlus/Theurgist/Spells/Formula.php by phpmd

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 (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 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 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

            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