Showing 387 of 387 total issues
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
) {
- Exclude checks
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
) {
- Exclude checks
syntax error, unexpected ')'
Open
Open
);
- Exclude checks
syntax error, unexpected ')'
Open
Open
)
- Exclude checks
syntax error, unexpected ')'
Open
Open
)
- Exclude checks
Possibly zero references to use statement for classlike/namespace JsonSchema
(\PHPModelGenerator\Model\SchemaDefinition\JsonSchema)
Open
Open
use PHPModelGenerator\Model\SchemaDefinition\JsonSchema;
- Exclude checks
Possibly zero references to use statement for classlike/namespace SchemaProcessor
(\PHPModelGenerator\SchemaProcessor\SchemaProcessor)
Open
Open
use PHPModelGenerator\SchemaProcessor\SchemaProcessor;
- Exclude checks
syntax error, unexpected ')'
Open
Open
);
- Exclude checks
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
) {
- Exclude checks
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
): PropertyInterface {
- Exclude checks
Rename "$attribute" which has the same name as the field declared at line 25. Open
Open
$attribute = !$this->isInternal() && $variableName && preg_match('/^\d/', $this->attribute) === 1
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
syntax error, unexpected ')'
Open
Open
);
- Exclude checks
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
): PropertyInterface;
- Exclude checks
Possibly zero references to use statement for classlike/namespace SchemaException
(\PHPModelGenerator\Exception\SchemaException)
Open
Open
use PHPModelGenerator\Exception\SchemaException;
- Exclude checks
syntax error, unexpected ')'
Open
Open
);
- Exclude checks
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
): void {
- Exclude checks
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
) {
- Exclude checks
Define a constant instead of duplicating this literal "schemas" 3 times. Open
Open
if (!isset($this->openAPIv3Spec['components']['schemas']) ||
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
syntax error, unexpected ')'
Open
Open
);
- Exclude checks
syntax error, unexpected ')'
Open
Open
)
- Exclude checks