mundipagg/magento2

View on GitHub

Showing 453 of 453 total issues

Method installProductsSubscription has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function installProductsSubscription(SchemaSetupInterface $installer)
    {
        $tableName = $installer->getTable('mundipagg_module_core_recurrence_products_subscription');
        if (!$installer->getConnection()->isTableExists($tableName)) {
            $customer = $installer->getConnection()
Severity: Major
Found in Setup/InstallSchema.php - About 3 hrs to fix

    Method installSubProducts has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function installSubProducts(SchemaSetupInterface $installer)
        {
            $tableName = $installer->getTable('mundipagg_module_core_recurrence_sub_products');
            if (!$installer->getConnection()->isTableExists($tableName)) {
                $customer = $installer->getConnection()
    Severity: Major
    Found in Setup/InstallSchema.php - About 3 hrs to fix

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

          private function getBoletoLinkFromOrder($info)
          {
              $lastTransId = $info->getLastTransId();
              $orderId = substr($lastTransId, 0, 19);
      
      
      Severity: Major
      Found in Block/Payment/Info/Billet.php and 2 other locations - About 3 hrs to fix
      Block/Payment/Billet.php on lines 94..118
      Block/Payment/Info/BilletCreditCard.php on lines 131..155

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 152.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

          private function getBoletoLinkFromOrder($info)
          {
              $lastTransId = $info->getLastTransId();
              $orderId = substr($lastTransId, 0, 19);
      
      
      Severity: Major
      Found in Block/Payment/Info/BilletCreditCard.php and 2 other locations - About 3 hrs to fix
      Block/Payment/Billet.php on lines 94..118
      Block/Payment/Info/Billet.php on lines 70..94

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 152.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

          private function getBoletoLinkFromOrder($info)
          {
              $lastTransId = $info->getLastTransId();
              $orderId = substr($lastTransId, 0, 19);
      
      
      Severity: Major
      Found in Block/Payment/Billet.php and 2 other locations - About 3 hrs to fix
      Block/Payment/Info/Billet.php on lines 70..94
      Block/Payment/Info/BilletCreditCard.php on lines 131..155

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 152.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Method execute has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function execute(Observer $observer)
          {
              $method = $this->readMethodArgument($observer);
              $info = $method->getInfoInstance();
              $data = $this->readDataArgument($observer);
      Severity: Major
      Found in Observer/TwoCreditCardDataAssignObserver.php - About 3 hrs to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            CreditCardValidator.isInputInstallmentInvalid = function (element) {
                if (element.val() === "") {
                    element.parent().find(".hosted-error")
                        .css("opacity", "1")
                        .css("color", "red");
        Severity: Major
        Found in view/adminhtml/web/js/core/checkout/CreditCardValidator.js and 1 other location - About 3 hrs to fix
        view/adminhtml/web/js/core/checkout/CreditCardValidator.js on lines 81..94

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            CreditCardValidator.isInputInvalid = function (element, message = "") {
        
                if (element.val() === "") {
                    element.parent().find(".hosted-error")
                        .css("opacity", "1")
        Severity: Major
        Found in view/adminhtml/web/js/core/checkout/CreditCardValidator.js and 1 other location - About 3 hrs to fix
        view/adminhtml/web/js/core/checkout/CreditCardValidator.js on lines 116..128

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Method installSubscriptionRepetitions has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function installSubscriptionRepetitions(SchemaSetupInterface $installer)
            {
                $tableName = $installer->getTable('mundipagg_module_core_recurrence_subscription_repetitions');
                if (!$installer->getConnection()->isTableExists($tableName)) {
                    $configTable = $installer->getConnection()
        Severity: Major
        Found in Setup/InstallSchema.php - About 3 hrs to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              public function create()
              {
          
                  $installmentsActive = $this->getConfig()->isActive();
          
          
          Severity: Major
          Found in Model/Installments/BuilderByBrandAndAmount.php and 1 other location - About 3 hrs to fix
          Model/Installments/BuilderByBrand.php on lines 52..85

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 145.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              public function create()
              {
          
                  $installmentsActive = $this->getConfig()->isActive();
          
          
          Severity: Major
          Found in Model/Installments/BuilderByBrand.php and 1 other location - About 3 hrs to fix
          Model/Installments/BuilderByBrandAndAmount.php on lines 52..85

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 145.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method installSubscriptionItems has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function installSubscriptionItems(SchemaSetupInterface $installer)
              {
                  $tableName = $installer->getTable(
                      'mundipagg_module_core_recurrence_subscription_items'
                  );
          Severity: Major
          Found in Setup/InstallSchema.php - About 3 hrs to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            CreditCardModel.prototype.validate = function () {
            
                var creditCardValidator = new CreditCardValidator(this.formObject);
                var isCreditCardValid = creditCardValidator.validate();
            
            
            Severity: Major
            Found in view/frontend/web/js/core/models/CreditCardModel.js and 1 other location - About 3 hrs to fix
            view/frontend/web/js/core/models/DebitModel.js on lines 39..52

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 95.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            DebitModel.prototype.validate = function () {
            
                var creditCardValidator = new CreditCardValidator(this.formObject);
                var isCreditCardValid = creditCardValidator.validate();
            
            
            Severity: Major
            Found in view/frontend/web/js/core/models/DebitModel.js and 1 other location - About 3 hrs to fix
            view/frontend/web/js/core/models/CreditCardModel.js on lines 39..52

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 95.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method fillMeta has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function fillMeta()
                {
                    return [
                        'id' => $this->getTextColumn('id', true, __('ID'), 10),
                        'thumbnail' => [
            Severity: Major
            Found in Ui/DataProvider/Product/Form/Modifier/Plan.php - About 2 hrs to fix

              RequestDataProvider has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class RequestDataProvider
                  extends AbstractRequestDataProvider
                  implements BilletCreditCardRequestDataProviderInterface
              {
                  protected $config;

                RequestDataProvider has 25 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class RequestDataProvider
                    extends AbstractRequestDataProvider
                    implements CreditCardRequestDataProviderInterface
                {
                    protected $config;

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Class EavPaymentMethods
                   *
                  Severity: Major
                  Found in Model/Source/EavPaymentMethods.php and 1 other location - About 2 hrs to fix
                  Model/Source/EavInterval.php on lines 1..52

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 138.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Class EavPaymentMethods
                   *
                  Severity: Major
                  Found in Model/Source/EavInterval.php and 1 other location - About 2 hrs to fix
                  Model/Source/EavPaymentMethods.php on lines 1..52

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 138.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Method updateVersionOneZeroTwo has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function updateVersionOneZeroTwo($setup)
                      {
                          $installer = $setup;
                          $installer->startSetup();
                   
                  Severity: Major
                  Found in Setup/UpgradeSchema.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language