Showing 134 of 134 total issues
Argument 1 (var)
is string
but \count()
takes \Countable|array
Open
Open
if (count($types) === 1) {
- Exclude checks
Class extends undeclared class \Google_Client
Open
Open
class GClient extends Google_Client
- 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 (json)
is \Activerules\Nugget\type
but \json_decode()
takes string
Open
Open
$data = json_decode($data);
- Exclude checks
Catching undeclared class \Activerules\Nugget\Exception
(Did you mean class \Exception) Open
Open
} catch (Exception $ex) {
- Exclude checks
Class extends undeclared class \Aws\S3\S3Client
Open
Open
class SClient extends \Aws\S3\S3Client
- Exclude checks
Call to method useApplicationDefaultCredentials
from undeclared class \Google_Client
Open
Open
$client->useApplicationDefaultCredentials();
- Exclude checks
Suspicious attempt to unset an offset of a value of type string
Open
Open
unset($property['name']);
- Exclude checks
Reference to undeclared property \Activerules\Nugget\Nugget->schemaBuilder
Open
Open
$props[$property] = $nugget->schemaBuilder->loadPropertyFile($propertyFile);
- Exclude checks
Parameter $url
has undeclared type \Activerules\Nugget\type
Open
Open
public function loadGsheetCSV($url)
- Exclude checks
Returning type void
but processProperty()
is declared to return string
Open
Open
return;
- Exclude checks
Argument 2 (types)
is string
but \hydrateOneOfType()
takes array
defined at /code/src/bin/readPropertiesFromGoogle.php:117
Open
Open
hydrateOneOfType($property, $types);
- Exclude checks
Argument 2 (args)
is string
but \array_merge()
takes array
Open
Open
$property = array_merge($property, $typeData);
- Exclude checks
Define a constant instead of duplicating this literal "string" 9 times. Open
Open
'string' => [
- 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.