Showing 261 of 385 total issues
Consider simplifying this complex logical expression. Open
Open
if (!isset($paymentData['additional_information']['credit_card_document'])
|| ! isset($paymentData['additional_information']['hash'])
|| ! isset($paymentData['additional_information']['credit_card_token'])
|| ! isset($paymentData['additional_information']['credit_card_holder_name'])
|| ! isset($paymentData['additional_information']['credit_card_holder_birthdate'])
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
\Magento\Framework\Api\AttributeValueFactory $attributeFactory,
\Magento\Payment\Helper\Data $paymentData,
Function formataCampo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
function formataCampo(campo, Mascara, evento) {
var boleanoMascara;
var Digitato = evento.keyCode;
var exp = /\-|\.|\/|\(|\)| /g;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function sortData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
private static function sortData($text)
{
if (preg_match('/[-,\\n]/', $text)) {
$broken = preg_split('/[-,\\n]/', $text);
for ($i = 0; $i < strlen($broken[0]); $i++) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
\Magento\Framework\Model\ResourceModel\Db\Context $context,
\Magento\Backend\Model\Session $session,
\Magento\Sales\Model\Order $order,
\UOL\PagSeguro\Helper\Library $library,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
\Magento\Framework\Model\ResourceModel\Db\Context $context,
\Magento\Backend\Model\Session $session,
\Magento\Sales\Model\Order $order,
\UOL\PagSeguro\Helper\Library $library,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
\Magento\Framework\Model\ResourceModel\Db\Context $context,
\Magento\Backend\Model\Session $session,
\Magento\Sales\Model\Order $order,
\UOL\PagSeguro\Helper\Library $library,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Store\Model\StoreManagerInterface $storeManager,
Avoid deeply nested control flow statements. Open
Open
if (cache[k] === undefined) {
cache[k] = _fnGetCellData(settings, k, i, 'type');
}
Avoid deeply nested control flow statements. Open
Open
} else if (typeof aTargets[j] === 'number' && aTargets[j] < 0) {
/* Negative integer, right to left column counting */
fn(columns.length + aTargets[j], def);
} else if (typeof aTargets[j] === 'string') {
/* Class name matching on TH element */
Avoid deeply nested control flow statements. Open
Open
for (j = 0, jen = items.length; j < jen; j++) {
item = items[j];
if (type === 'cell') {
ret = fn.call(apiInst, context[i], item.row, item.column, i, j);
Avoid deeply nested control flow statements. Open
Open
for (var j = 0, jLen = val.length; j < jLen; j++) {
o = {};
setData(o, val[j], innerSrc);
data[a[i]].push(o);
}
Avoid deeply nested control flow statements. Open
Open
if (!detectedType && j !== types.length - 1) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if (
(tmp === -1 && search === 'removed') ||
(tmp >= 0 && search === 'applied')
) {
a.push(i);
Function _fnFilterColumn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
settings,
searchStr,
colIdx,
regex,
smart,
Function _
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_: function (settings, host, idx, buttons, page, pages) {
Avoid deeply nested control flow statements. Open
Open
if (
s(
o,
_fnGetCellData(settings, row, j),
host.anCells ? host.anCells[j] : null
Function fnFilter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
sInput,
iColumn,
bRegex,
bSmart,
bShowGlobal,
Avoid deeply nested control flow statements. Open
Open
if (data === null || data[a[i]] === undefined) {
return undefined;
}
Avoid deeply nested control flow statements. Open
Open
if (arrayNotation) {
// Array notation
a[i] = a[i].replace(__reArray, '');
// Condition allows simply [] to be passed in