Showing 61 of 148 total issues
Config
has 19 functions (exceeds 10 allowed). Consider refactoring. Open
class Config extends PaymentConfig
{
/**
* @const string
*/
ConfigCc
has 16 functions (exceeds 10 allowed). Consider refactoring. Open
class ConfigCc extends PaymentConfig
{
/**
* @const string
*/
Function handle
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function handle(array $handlingSubject, array $response)
{
if (!isset($handlingSubject['payment'])
|| !$handlingSubject['payment'] instanceof PaymentDataObjectInterface
) {
- 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
Oauth
has 12 functions (exceeds 10 allowed). Consider refactoring. Open
class Oauth extends Field
{
/**
* Template oAuth.
*/
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Config $config,
Context $context,
Json $json,
SearchCriteriaBuilder $searchCriteria,
TransactionRepositoryInterface $transaction,
Method getPurchaseItems
has 55 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function getPurchaseItems(
$order
) {
$result = [];
$items = $order->getItems();
Function initialize
has 47 lines of code (exceeds 40 allowed). Consider refactoring. Open
initialize() {
var self = this,
number;
self._super();
Function findForPaymentStatus
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function findForPaymentStatus($response, $charges)
{
$isPix = isset($response[self::RESPONSE_QR_CODES]);
$isTempCancel = false;
- 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 getPreOrderData
has 45 lines of code (exceeds 40 allowed). Consider refactoring. Open
getPreOrderData(
cardPayData
) {
var totalAmount = parseFloat(quote.totals()['base_grand_total']) * 100,
customerEmail = quote.guestEmail ? quote.guestEmail : window.checkoutConfig.customerData.email,
Method getPagBankInstallments
has 44 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function getPagBankInstallments($storeId, $creditCardBin, $amount)
{
/** @var LaminasClient $client */
$client = $this->httpClientFactory->create();
$url = $this->configBase->getApiUrl($storeId);
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
TypeListInterface $cacheTypeList,
Pool $cacheFrontendPool,
Logger $logger,
State $state,
ScopeConfigInterface $scopeConfig,
Method execute
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function execute()
{
$configDefault = false;
$params = $this->getRequest()->getParams();
Function validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function validate(array $validationSubject): ResultInterface
{
$response = SubjectReader::readResponse($validationSubject);
$isValid = $response['RESULT_CODE'];
- 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 execute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$configDefault = false;
$params = $this->getRequest()->getParams();
- 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 setAdditionalInfo
has 42 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function setAdditionalInfo($payment, $paymentMethod, $cardData)
{
$ccType = null;
$payment->setAdditionalInformation(
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
CommandPoolInterface $commandPool,
BuilderInterface $requestBuilder,
TransferFactoryInterface $transferFactory,
ClientInterface $client,
LoggerInterface $logger,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
TypeListInterface $cacheTypeList,
Pool $cacheFrontendPool,
JsonFactory $resultJsonFactory,
ConfigInterface $configInterface,
Function newToken
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function newToken($storeId = null)
{
$storeIds = $storeId ?: null;
$this->writeln('Init Referesh Token');
$inDefault = $this->getConfigInDefault();
- 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
ConfigBase $configBase,
ConfigCc $configCc,
CartInterface $cart,
CcConfig $ccConfig,
Source $assetSource,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
TypeListInterface $cacheTypeList,
Pool $cacheFrontendPool,
JsonFactory $resultJsonFactory,
StoreManagerInterface $storeManager,