elisei/pagbank-payment-magento

View on GitHub

Showing 61 of 148 total issues

Config has 19 functions (exceeds 10 allowed). Consider refactoring.
Open

class Config extends PaymentConfig
{
    /**
     * @const string
     */
Severity: Minor
Found in Gateway/Config/Config.php - About 3 hrs to fix

    ConfigCc has 16 functions (exceeds 10 allowed). Consider refactoring.
    Open

    class ConfigCc extends PaymentConfig
    {
        /**
         * @const string
         */
    Severity: Minor
    Found in Gateway/Config/ConfigCc.php - About 3 hrs to fix

      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
              ) {
      Severity: Minor
      Found in Gateway/Response/FetchPaymentHandler.php - About 2 hrs to fix

      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.
           */
      Severity: Minor
      Found in Block/Adminhtml/System/Config/Oauth.php - About 2 hrs to fix

        Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                Config $config,
                Context $context,
                Json $json,
                SearchCriteriaBuilder $searchCriteria,
                TransactionRepositoryInterface $transaction,
        Severity: Major
        Found in Controller/AbstractNotification.php - About 1 hr to fix

          Method getPurchaseItems has 55 lines of code (exceeds 40 allowed). Consider refactoring.
          Open

              public function getPurchaseItems(
                  $order
              ) {
                  $result = [];
                  $items = $order->getItems();
          Severity: Major
          Found in Gateway/Request/ItemsDataRequest.php - About 1 hr to fix

            Function initialize has 47 lines of code (exceeds 40 allowed). Consider refactoring.
            Open

                    initialize() {
                        var self = this,
                            number;
            
                        self._super();
            Severity: Minor
            Found in view/frontend/web/js/view/payment/cc-form.js - About 1 hr to fix

              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;
              
              
              Severity: Minor
              Found in Gateway/Response/FetchPaymentHandler.php - About 1 hr to fix

              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,
              Severity: Minor
              Found in view/base/web/js/model/pagbank-pre-order-data.js - About 1 hr to fix

                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);
                Severity: Minor
                Found in Model/Api/ConsultPSInstallments.php - About 1 hr to fix

                  Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          TypeListInterface $cacheTypeList,
                          Pool $cacheFrontendPool,
                          Logger $logger,
                          State $state,
                          ScopeConfigInterface $scopeConfig,
                  Severity: Major
                  Found in Model/Console/Command/Basic/Refresh.php - About 1 hr to fix

                    Method execute has 43 lines of code (exceeds 40 allowed). Consider refactoring.
                    Open

                        public function execute()
                        {
                            $configDefault = false;
                    
                            $params = $this->getRequest()->getParams();
                    Severity: Minor
                    Found in Controller/Adminhtml/System/Config/Oauth.php - About 1 hr to fix

                      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'];
                      Severity: Minor
                      Found in Gateway/Validator/GeneralResponseValidator.php - About 1 hr to fix

                      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();
                      Severity: Minor
                      Found in Controller/Adminhtml/System/Config/Oauth.php - About 1 hr to fix

                      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(
                      Severity: Minor
                      Found in Gateway/Response/TxnDataCcHandler.php - About 1 hr to fix

                        Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                CommandPoolInterface $commandPool,
                                BuilderInterface $requestBuilder,
                                TransferFactoryInterface $transferFactory,
                                ClientInterface $client,
                                LoggerInterface $logger,
                        Severity: Major
                        Found in Gateway/Command/PaymentCommand.php - About 1 hr to fix

                          Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  Context $context,
                                  TypeListInterface $cacheTypeList,
                                  Pool $cacheFrontendPool,
                                  JsonFactory $resultJsonFactory,
                                  ConfigInterface $configInterface,
                          Severity: Major
                          Found in Controller/Adminhtml/System/Config/Logout.php - About 1 hr to fix

                            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();
                            Severity: Minor
                            Found in Model/Console/Command/Basic/Refresh.php - About 55 mins to fix

                            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,
                            Severity: Major
                            Found in Model/Ui/ConfigProviderCc.php - About 50 mins to fix

                              Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      Context $context,
                                      TypeListInterface $cacheTypeList,
                                      Pool $cacheFrontendPool,
                                      JsonFactory $resultJsonFactory,
                                      StoreManagerInterface $storeManager,
                              Severity: Major
                              Found in Controller/Adminhtml/System/Config/Oauth.php - About 50 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language