Showing 134 of 134 total issues
Argument 1 (arr1)
is string
but \array_merge()
takes array
Open
Open
$property = array_merge($property, $resolved);
- Exclude checks
Parameter $property
has undeclared type \type
Open
Open
function propertyExists($property)
- Exclude checks
Reference to undeclared property \Activerules\Nugget\Nugget->schemaBuilder
Open
Open
$nugget->schemaBuilder->mergeRequired($parentDef, $schemaDef);
- Exclude checks
Call to method getFilename
on non-class type string
Open
Open
$name = $fileInfo->getFilename();
- Exclude checks
Call to undeclared method \Activerules\Nugget\GClient::setScopes
Open
Open
$this->setScopes($scopes);
- Exclude checks
Reference to undeclared property \Activerules\Nugget\GSheet->spreadsheets_values
Open
Open
return $this->spreadsheets_values->get($spreadsheetID, $range);
- Exclude checks
Call to method fails
from undeclared class \Activerules\JsonGuard\Validator
Open
Open
return $validator->fails() ? false : true;
- 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 (filename)
is \Activerules\Nugget\type
but \file_get_contents()
takes string
Open
Open
$file = file_get_contents($url);
- Exclude checks
Reference to constant SPREADSHEETS_READONLY
from undeclared class \Google_Service_Sheets
Open
Open
define('SCOPES', implode(' ', array(Google_Service_Sheets::SPREADSHEETS_READONLY)));
- Exclude checks
Either remove or fill this block of code. Open
Open
} catch (NuggetException $ex) {
}
- Read upRead up
- Exclude checks
Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.
Noncompliant Code Example
for ($i = 0; $i < 42; $i++){} // Empty on purpose or missing piece of code ?
Exceptions
When a block contains a comment, this block is not considered to be empty.
Class extends undeclared class \Google_Service_Sheets
Open
Open
class GSheet extends Google_Service_Sheets
- Exclude checks
Argument 1 (property)
is array{description:mixed,types:array<int>,name:mixed}</int>
but \processProperty()
takes string
defined at /code/src/bin/readPropertiesFromGoogle.php:71
Open
Open
processProperty($property);
- Exclude checks
When fetching an array index from a value of type string,
found an array index of type 'name',
but expected the index to be of type int
Open
Open
$propertyName = $property['name'];
- Exclude checks
Returning type bool
but propertyExists()
is declared to return \type
Open
Open
return file_exists(PROPERTYDIR + DIRECTORY_SEPARATOR + $property['name'] + '.json');
- Exclude checks
Argument 1 (refString)
is object
but \loadRef()
takes string
defined at /code/src/bin/schemaFromObject.php:358
Open
Open
loadRef($def, $defs);
- Exclude checks
Define a constant instead of duplicating this literal "comment" 7 times. Open
Open
'comment' => 'signed 32 bits'
- 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.
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_Client
Open
Open
parent::__construct($config);
- Exclude checks
Returning type false|string
but loadGsheetCSV()
is declared to return object
Open
Open
return $file;
- Exclude checks