Showing 68 of 159 total issues
ConfigCc
has 21 functions (exceeds 10 allowed). Consider refactoring. Open
class ConfigCc extends PaymentConfig
{
/**
* @const string
*/
Config
has 21 functions (exceeds 10 allowed). Consider refactoring. Open
class Config 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.
*/
File Config.php
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* PagBank Payment Magento Module.
*
* Copyright © 2023 PagBank. All rights reserved.
Function initialize
has 56 lines of code (exceeds 40 allowed). Consider refactoring. Open
initialize() {
var self = this,
number;
self._super();
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 getPagBankPlace
has 53 lines of code (exceeds 40 allowed). Consider refactoring. Open
getPagBankPlace(context, callback, errorCallback) {
let encrypted,
countPlaceOrder = context.countTryPlaceOrder(),
maxTry = context.getMaxTryPlaceOrder(),
typePay = context.cardTypeTransaction(),
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
Method setAdditionalInfo
has 46 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function setAdditionalInfo($payment, $paymentMethod, $cardData)
{
$ccType = null;
$installment = 1;
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, $cardTypeTransaction = 'CREDIT_CARD')
{
/** @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 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
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
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
TypeListInterface $cacheTypeList,
Pool $cacheFrontendPool,
JsonFactory $resultJsonFactory,
ConfigInterface $configInterface,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
CommandPoolInterface $commandPool,
BuilderInterface $requestBuilder,
TransferFactoryInterface $transferFactory,
ClientInterface $client,
LoggerInterface $logger,
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"