Showing 134 of 134 total issues
Suspicious array access to \type
Open
Open
return file_exists(PROPERTYDIR + DIRECTORY_SEPARATOR + $property['name'] + '.json');
- Exclude checks
Define a constant instead of duplicating this literal "integer" 3 times. Open
Open
'integer' => [
- 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.
Call to method isDir
on non-class type string
Open
Open
if (!$fileInfo->isDot() && !$fileInfo->isDir() && substr($name, 0, 1) != '.') {
- Exclude checks
Possibly zero references to use statement for classlike/namespace NuggetException
(\Activerules\Nugget\Exception\NuggetException)
Open
Open
use Activerules\Nugget\Exception\NuggetException;
- Exclude checks
Reference to undeclared class \Google_Service_Sheets
Open
Open
parent::__construct($client);
- Exclude checks
Saw an @param annotation for scopes,
but it was not found in the param list of function __construct($url)
Open
Open
* @param array $scopes
- Exclude checks
Call to method __construct
from undeclared class \Google_Client
Open
Open
$client = new Google_Client();
- Exclude checks
Reference to instance property spreadsheets_values
from undeclared class \Google_Service_Sheets
Open
Open
$response = $service->spreadsheets_values->get($spreadsheetID, $range);
- Exclude checks
Parameter $properties
has undeclared type \type
Open
Open
function processProperties($properties)
- Exclude checks
Return type of propertyExists()
is undeclared type \type
Open
Open
function propertyExists($property)
- Exclude checks
Argument 1 (filename)
is float|int
but \file_exists()
takes string
Open
Open
return file_exists(PROPERTYDIR + DIRECTORY_SEPARATOR + $property['name'] + '.json');
- Exclude checks
Argument 3 (defs)
is string
but \resolvePropertyReference()
takes array
defined at /code/src/bin/schemaFromObject.php:309
Open
Open
resolvePropertyReference($prop, $def, $defs);
- Exclude checks
Argument 1 (schema)
is false|string
but \populateRef()
takes object
defined at /code/src/bin/schemaFromObject.php:68
Open
Open
populateRef($name, $defs);
- Exclude checks
Saw an @param annotation for credentials,
but it was not found in the param list of function __construct($url)
Open
Open
* @param array $credentials
- Exclude checks
Saw an @param annotation for key,
but it was not found in the param list of function __construct($config)
Open
Open
* @param string $key
- Exclude checks
Possibly zero references to use statement for classlike/namespace NuggetException
(\Activerules\Nugget\Exception\NuggetException)
Open
Open
use Activerules\Nugget\Exception\NuggetException;
- Exclude checks
Argument 1 (property)
is string
but \propertyExists()
takes \type
defined at /code/src/bin/readPropertiesFromGoogle.php:192
Open
Open
if (propertyExists($property)) {
- Exclude checks
Possibly zero references to use statement for classlike/namespace NuggetException
(\Activerules\Nugget\Exception\NuggetException)
Open
Open
use Activerules\Nugget\Exception\NuggetException;
- Exclude checks
Call to method __construct
from undeclared class \Activerules\JsonGuard\Validator
Open
Open
$validator = new \Activerules\JsonGuard\Validator($data, $schema);
- Exclude checks
When fetching an array index from a value of type string,
found an array index of type 'types',
but expected the index to be of type int
Open
Open
$types = $property['types'];
- Exclude checks