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');
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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
{
}
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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(),
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)) {
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)) {
Method getDifficultyChange
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDifficultyChange(): DifficultyChange
{
$modifierParameters = [
$this->getAttackWithAddition(),
$this->getNumberOfConditionsWithAddition(),
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) {
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 */
- Read upRead up
- Exclude checks
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) {
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,