Showing 109 of 109 total issues
Argument 2 (raw_output)
is 1
but \md5()
takes bool
Open
Open
$uuid = md5($namespace . $node, 1);
- Create a ticketCreate a ticket
- Exclude checks
Returning type int
but __get()
is declared to return \TakeawayTown\LaravelUuid\Classes\number|null|string
Open
Open
return (int) 1;
- Create a ticketCreate a ticket
- Exclude checks
Returning type int
but __get()
is declared to return \TakeawayTown\LaravelUuid\Classes\number|null|string
Open
Open
return (int) 3;
- Create a ticketCreate a ticket
- Exclude checks
Saw possibly unextractable annotation for a fragment of comment '* @param string uuid of the model.':
after string,
did not see an element name (will guess based on comment order) Open
Open
* @param string uuid of the model.
- Create a ticketCreate a ticket
- Exclude checks
Static call to undeclared method \TakeawayTown\LaravelUuid\Classes\Uuid,1::creating
Open
Open
static::creating(function ($model) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared function \config()
Open
Open
$model->{config('uuid.uuid_column')} = $uuid;
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \TakeawayTown\LaravelUuid\Classes\InvalidArgumentException
(Did you mean class \InvalidArgumentException) Open
Open
throw new InvalidArgumentException('Input must be a 128-bit integer.');
- Create a ticketCreate a ticket
- Exclude checks
Define a constant instead of duplicating this literal "uuid.uuid_column" 6 times. Open
Open
if (!$model->{config('uuid.uuid_column')}) {
- Read upRead up
- Create a ticketCreate a ticket
- 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 undeclared function \config()
Open
Open
$results = $query->where(config('uuid.uuid_column'), $uuid);
- Create a ticketCreate a ticket
- Exclude checks