mundipagg/magento2

View on GitHub
Concrete/Magento2PlatformOrderDecorator.php

Summary

Maintainability
F
6 days
Test Coverage

File Magento2PlatformOrderDecorator.php has 945 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace MundiPagg\MundiPagg\Concrete;

use Magento\Customer\Model\ResourceModel\CustomerRepository;
Severity: Major
Found in Concrete/Magento2PlatformOrderDecorator.php - About 2 days to fix

    Magento2PlatformOrderDecorator has 62 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Magento2PlatformOrderDecorator extends AbstractPlatformOrderDecorator
    {
        /** @var Order */
        protected $platformOrder;
    
    
    Severity: Major
    Found in Concrete/Magento2PlatformOrderDecorator.php - About 1 day to fix

      Method extractPaymentDataFromMundipaggBilletCreditcard has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function extractPaymentDataFromMundipaggBilletCreditcard(
              $additionalInformation,
              &$paymentData, $payment
          )
          {
      Severity: Major
      Found in Concrete/Magento2PlatformOrderDecorator.php - About 2 hrs to fix

        Method getRegisteredCustomer has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getRegisteredCustomer($quote)
            {
                $quoteCustomer = $quote->getCustomer();
        
                $addresses = $quoteCustomer->getAddresses();
        Severity: Major
        Found in Concrete/Magento2PlatformOrderDecorator.php - About 2 hrs to fix

          Method extractPaymentDataFromMundipaggTwoCreditCard has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function extractPaymentDataFromMundipaggTwoCreditCard
              ($additionalInformation, &$paymentData, $payment)
              {
                  $moneyService = new MoneyService();
                  $indexes = ['first', 'second'];
          Severity: Minor
          Found in Concrete/Magento2PlatformOrderDecorator.php - About 2 hrs to fix

            Method extractBasePaymentData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function extractBasePaymentData($additionalInformation)
                {
                    $moneyService = new MoneyService();
                    $identifier = null;
                    $customerId = null;
            Severity: Minor
            Found in Concrete/Magento2PlatformOrderDecorator.php - About 1 hr to fix

              Method getItemCollection has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getItemCollection()
                  {
                      $moneyService = new MoneyService();
                      $quote = $this->getQuote();
                      $itemCollection = $quote->getItemsCollection();
              Severity: Minor
              Found in Concrete/Magento2PlatformOrderDecorator.php - About 1 hr to fix

                Method getAddress has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getAddress($platformAddress)
                    {
                        $address = new Address();
                        $addressAttributes =
                            MPSetup::getModuleConfiguration()->getAddressAttributes();
                Severity: Minor
                Found in Concrete/Magento2PlatformOrderDecorator.php - About 1 hr to fix

                  Function extractPaymentDataFromMundipaggTwoCreditCard has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function extractPaymentDataFromMundipaggTwoCreditCard
                      ($additionalInformation, &$paymentData, $payment)
                      {
                          $moneyService = new MoneyService();
                          $indexes = ['first', 'second'];
                  Severity: Minor
                  Found in Concrete/Magento2PlatformOrderDecorator.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 extractMultibuyerData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function extractMultibuyerData(
                          $prefix,
                          $additionalInformation,
                          $index = null
                      )
                  Severity: Minor
                  Found in Concrete/Magento2PlatformOrderDecorator.php - About 1 hr to fix

                    Function getAddress has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function getAddress($platformAddress)
                        {
                            $address = new Address();
                            $addressAttributes =
                                MPSetup::getModuleConfiguration()->getAddressAttributes();
                    Severity: Minor
                    Found in Concrete/Magento2PlatformOrderDecorator.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 getItemCollection has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getItemCollection()
                        {
                            $moneyService = new MoneyService();
                            $quote = $this->getQuote();
                            $itemCollection = $quote->getItemsCollection();
                    Severity: Minor
                    Found in Concrete/Magento2PlatformOrderDecorator.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 getPaymentMethodCollection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getPaymentMethodCollection()
                        {
                            $payments = $this->getPaymentCollection();
                    
                            if (empty($payments)) {
                    Severity: Minor
                    Found in Concrete/Magento2PlatformOrderDecorator.php - About 1 hr to fix

                      Method getGuestCustomer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function getGuestCustomer($quote)
                          {
                              $guestAddress = $quote->getBillingAddress();
                      
                              $customer = new Customer();
                      Severity: Minor
                      Found in Concrete/Magento2PlatformOrderDecorator.php - About 1 hr to fix

                        Function extractBasePaymentData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function extractBasePaymentData($additionalInformation)
                            {
                                $moneyService = new MoneyService();
                                $identifier = null;
                                $customerId = null;
                        Severity: Minor
                        Found in Concrete/Magento2PlatformOrderDecorator.php - About 45 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

                        Function extractPaymentDataFromMundipaggBilletCreditcard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function extractPaymentDataFromMundipaggBilletCreditcard(
                                $additionalInformation,
                                &$paymentData, $payment
                            )
                            {
                        Severity: Minor
                        Found in Concrete/Magento2PlatformOrderDecorator.php - About 35 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

                        Function getRegisteredCustomer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function getRegisteredCustomer($quote)
                            {
                                $quoteCustomer = $quote->getCustomer();
                        
                                $addresses = $quoteCustomer->getAddresses();
                        Severity: Minor
                        Found in Concrete/Magento2PlatformOrderDecorator.php - About 25 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

                        There are no issues that match your filters.

                        Category
                        Status