Showing 265 of 271 total issues
Define a constant instead of duplicating this literal "First Name" 3 times. Open
'customer_firstName' => 'First Name',
- 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.
Reference to undeclared property \tuyakhov\braintree\ActiveField->inputOptions
Open
$config = array_merge(['options' => $this->inputOptions], $config);
- Exclude checks
Class extends undeclared class \yii\bootstrap\ActiveForm
(Did you mean class \tuyakhov\braintree\ActiveForm) Open
class ActiveForm extends \yii\bootstrap\ActiveForm
- Exclude checks
Define a constant instead of duplicating this literal "paymentMethodToken" 5 times. Open
['amount', 'paymentMethodToken'],
- 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 create
from undeclared class \Braintree\CreditCard
Open
$result = CreditCard::create($sendArray);
- Exclude checks
Define a constant instead of duplicating this literal "amount" 4 times. Open
[['amount'], 'number'],
- 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.
Reference to instance property id
from undeclared class \Braintree\Plan
Open
if ($plan->id === $planId) {
- Exclude checks
Return type of findTransaction()
is undeclared type \Braintree\Transaction
Open
public function findTransaction(string $id): Transaction
- Exclude checks
Define a constant instead of duplicating this literal "status" 9 times. Open
return ['status' => $result->success, 'result' => $result];
- 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.
Class extends undeclared class \yii\bootstrap\ActiveField
(Did you mean class \tuyakhov\braintree\ActiveField) Open
class ActiveField extends \yii\bootstrap\ActiveField
- Exclude checks
Possibly zero references to public method \tuyakhov\braintree\ActiveField::widget()
Open
public function widget($class, $config = [])
- Exclude checks
Call to method sale
from undeclared class \Braintree\Transaction
Open
$result = Transaction::sale(
- Exclude checks
Return type of searchTransaction()
is undeclared type \Braintree\ResourceCollection
Open
public function searchTransaction($params = []): ResourceCollection
- Exclude checks
Define a constant instead of duplicating this literal "options" 3 times. Open
$this->options['options']['submitForSettlement'] = $submitForSettlement;
- 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.
Reference to undeclared class \yii\bootstrap\ActiveField
(Did you mean class \tuyakhov\braintree\ActiveField) Open
return parent::widget($class, $config);
- Exclude checks
Possibly zero write references to public property \tuyakhov\braintree\Braintree->merchantId
Open
public $merchantId;
- Exclude checks
Property \tuyakhov\braintree\Braintree->plans
has undeclared type \Braintree\Plan[]
Open
protected $plans;
- Exclude checks
Possibly zero references to public method \tuyakhov\braintree\Braintree::getUrlManager()
Open
public function getUrlManager(): UrlManager
- Exclude checks
Call to method update
from undeclared class \Braintree\PaymentMethod
Open
$result = PaymentMethod::update($this->options['paymentMethodToken'], $this->options['paymentMethod']);
- Exclude checks
Assigning array<string></string>
to property but \tuyakhov\braintree\Braintree->options
is array<string></string>
Open
$this->options['customer']['id'] = $this->options['customerId'];
- Exclude checks