arastta/arastta

View on GitHub
admin/controller/tool/export_import.php

Summary

Maintainability
F
6 days
Test Coverage

File export_import.php has 429 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @package     Arastta eCommerce
 * @copyright   2015-2017 Arastta Association. All rights reserved.
 * @copyright   See CREDITS.txt for credits and other copyright notices.
Severity: Minor
Found in admin/controller/tool/export_import.php - About 6 hrs to fix

    Function getForm has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getForm()
        {
            $data = $this->language->all();
    
            $data['exist_filter'] = $this->model_tool_export_import->existFilter();
    Severity: Minor
    Found in admin/controller/tool/export_import.php - About 6 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

    Function validateDownloadForm has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function validateDownloadForm()
        {
            if (!$this->user->hasPermission('access', 'tool/export_import')) {
                $this->error['warning'] = $this->language->get('error_permission');
                return false;
    Severity: Minor
    Found in admin/controller/tool/export_import.php - About 5 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

    Function validateSettingsForm has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function validateSettingsForm()
        {
            if (!$this->user->hasPermission('access', 'tool/export_import')) {
                $this->error['warning'] = $this->language->get('error_permission');
                return false;
    Severity: Minor
    Found in admin/controller/tool/export_import.php - About 5 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

    Method getForm has 138 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getForm()
        {
            $data = $this->language->all();
    
            $data['exist_filter'] = $this->model_tool_export_import->existFilter();
    Severity: Major
    Found in admin/controller/tool/export_import.php - About 5 hrs to fix

      Function download has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function download()
          {
              $this->load->language('tool/export_import');
              $this->document->setTitle($this->language->get('heading_title'));
      
      
      Severity: Minor
      Found in admin/controller/tool/export_import.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

      Function validateUploadForm has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function validateUploadForm()
          {
              if (!$this->user->hasPermission('modify', 'tool/export_import')) {
                  $this->error['warning'] = $this->language->get('error_permission');
              } elseif (!isset($this->request->post['incremental'])) {
      Severity: Minor
      Found in admin/controller/tool/export_import.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

      Method validateSettingsForm has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function validateSettingsForm()
          {
              if (!$this->user->hasPermission('access', 'tool/export_import')) {
                  $this->error['warning'] = $this->language->get('error_permission');
                  return false;
      Severity: Major
      Found in admin/controller/tool/export_import.php - About 2 hrs to fix

        Method validateDownloadForm has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function validateDownloadForm()
            {
                if (!$this->user->hasPermission('access', 'tool/export_import')) {
                    $this->error['warning'] = $this->language->get('error_permission');
                    return false;
        Severity: Major
        Found in admin/controller/tool/export_import.php - About 2 hrs to fix

          Method download has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function download()
              {
                  $this->load->language('tool/export_import');
                  $this->document->setTitle($this->language->get('heading_title'));
          
          
          Severity: Minor
          Found in admin/controller/tool/export_import.php - About 1 hr to fix

            Function returnBytes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function returnBytes($val)
                {
                    $val = trim($val);
                
                    switch (strtolower(substr($val, -1))) {
            Severity: Minor
            Found in admin/controller/tool/export_import.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 returnBytes has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function returnBytes($val)
                {
                    $val = trim($val);
                
                    switch (strtolower(substr($val, -1))) {
            Severity: Minor
            Found in admin/controller/tool/export_import.php - About 1 hr to fix

              Method validateUploadForm has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function validateUploadForm()
                  {
                      if (!$this->user->hasPermission('modify', 'tool/export_import')) {
                          $this->error['warning'] = $this->language->get('error_permission');
                      } elseif (!isset($this->request->post['incremental'])) {
              Severity: Minor
              Found in admin/controller/tool/export_import.php - About 1 hr to fix

                Function upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function upload()
                    {
                        $this->load->language('tool/export_import');
                
                        $this->document->setTitle($this->language->get('heading_title'));
                Severity: Minor
                Found in admin/controller/tool/export_import.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

                Avoid too many return statements within this method.
                Open

                                    return false;
                Severity: Major
                Found in admin/controller/tool/export_import.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return false;
                  Severity: Major
                  Found in admin/controller/tool/export_import.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return true;
                    Severity: Major
                    Found in admin/controller/tool/export_import.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return false;
                      Severity: Major
                      Found in admin/controller/tool/export_import.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                            return false;
                        Severity: Major
                        Found in admin/controller/tool/export_import.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                              return false;
                          Severity: Major
                          Found in admin/controller/tool/export_import.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                return false;
                            Severity: Major
                            Found in admin/controller/tool/export_import.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return true;
                              Severity: Major
                              Found in admin/controller/tool/export_import.php - About 30 mins to fix

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

                                    public function settings()
                                    {
                                        $this->load->language('tool/export_import');
                                        $this->document->setTitle($this->language->get('heading_title'));
                                        $this->load->model('tool/export_import');
                                Severity: Minor
                                Found in admin/controller/tool/export_import.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

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

                                        if (!$this->config->get('export_import_settings_use_attribute_group_id')) {
                                            $attribute_group_names = $this->model_tool_export_import->getAttributeGroupNameCounts();
                                            foreach ($attribute_group_names as $attribute_group_name) {
                                                if ($attribute_group_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $attribute_group_name['name'], $this->language->get('error_attribute_group_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 332..340
                                admin/controller/tool/export_import.php on lines 342..350
                                admin/controller/tool/export_import.php on lines 362..370
                                admin/controller/tool/export_import.php on lines 372..380
                                admin/controller/tool/export_import.php on lines 382..390

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (empty($this->request->post['export_import_settings_use_filter_id'])) {
                                            $filter_names = $this->model_tool_export_import->getFilterNameCounts();
                                            foreach ($filter_names as $filter_name) {
                                                if ($filter_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $filter_name['name'], $this->language->get('error_filter_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 438..446
                                admin/controller/tool/export_import.php on lines 448..456
                                admin/controller/tool/export_import.php on lines 458..466
                                admin/controller/tool/export_import.php on lines 468..476
                                admin/controller/tool/export_import.php on lines 478..486

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (!$this->config->get('export_import_settings_use_option_id')) {
                                            $option_names = $this->model_tool_export_import->getOptionNameCounts();
                                            foreach ($option_names as $option_name) {
                                                if ($option_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $option_name['name'], $this->language->get('error_option_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 342..350
                                admin/controller/tool/export_import.php on lines 352..360
                                admin/controller/tool/export_import.php on lines 362..370
                                admin/controller/tool/export_import.php on lines 372..380
                                admin/controller/tool/export_import.php on lines 382..390

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (!$this->config->get('export_import_settings_use_filter_id')) {
                                            $filter_names = $this->model_tool_export_import->getFilterNameCounts();
                                            foreach ($filter_names as $filter_name) {
                                                if ($filter_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $filter_name['name'], $this->language->get('error_filter_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 332..340
                                admin/controller/tool/export_import.php on lines 342..350
                                admin/controller/tool/export_import.php on lines 352..360
                                admin/controller/tool/export_import.php on lines 362..370
                                admin/controller/tool/export_import.php on lines 372..380

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (!$this->config->get('export_import_settings_use_option_value_id')) {
                                            $option_value_names = $this->model_tool_export_import->getOptionValueNameCounts();
                                            foreach ($option_value_names as $option_value_name) {
                                                if ($option_value_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $option_value_name['name'], $this->language->get('error_option_value_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 332..340
                                admin/controller/tool/export_import.php on lines 352..360
                                admin/controller/tool/export_import.php on lines 362..370
                                admin/controller/tool/export_import.php on lines 372..380
                                admin/controller/tool/export_import.php on lines 382..390

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (!$this->config->get('export_import_settings_use_attribute_id')) {
                                            $attribute_names = $this->model_tool_export_import->getAttributeNameCounts();
                                            foreach ($attribute_names as $attribute_name) {
                                                if ($attribute_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $attribute_name['name'], $this->language->get('error_attribute_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 332..340
                                admin/controller/tool/export_import.php on lines 342..350
                                admin/controller/tool/export_import.php on lines 352..360
                                admin/controller/tool/export_import.php on lines 372..380
                                admin/controller/tool/export_import.php on lines 382..390

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (!$this->config->get('export_import_settings_use_filter_group_id')) {
                                            $filter_group_names = $this->model_tool_export_import->getFilterGroupNameCounts();
                                            foreach ($filter_group_names as $filter_group_name) {
                                                if ($filter_group_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $filter_group_name['name'], $this->language->get('error_filter_group_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 332..340
                                admin/controller/tool/export_import.php on lines 342..350
                                admin/controller/tool/export_import.php on lines 352..360
                                admin/controller/tool/export_import.php on lines 362..370
                                admin/controller/tool/export_import.php on lines 382..390

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (empty($this->request->post['export_import_settings_use_option_id'])) {
                                            $option_names = $this->model_tool_export_import->getOptionNameCounts();
                                            foreach ($option_names as $option_name) {
                                                if ($option_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $option_name['name'], $this->language->get('error_option_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 448..456
                                admin/controller/tool/export_import.php on lines 458..466
                                admin/controller/tool/export_import.php on lines 468..476
                                admin/controller/tool/export_import.php on lines 478..486
                                admin/controller/tool/export_import.php on lines 488..496

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (empty($this->request->post['export_import_settings_use_attribute_group_id'])) {
                                            $attribute_group_names = $this->model_tool_export_import->getAttributeGroupNameCounts();
                                            foreach ($attribute_group_names as $attribute_group_name) {
                                                if ($attribute_group_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $attribute_group_name['name'], $this->language->get('error_attribute_group_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 438..446
                                admin/controller/tool/export_import.php on lines 448..456
                                admin/controller/tool/export_import.php on lines 468..476
                                admin/controller/tool/export_import.php on lines 478..486
                                admin/controller/tool/export_import.php on lines 488..496

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (empty($this->request->post['export_import_settings_use_option_value_id'])) {
                                            $option_value_names = $this->model_tool_export_import->getOptionValueNameCounts();
                                            foreach ($option_value_names as $option_value_name) {
                                                if ($option_value_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $option_value_name['name'], $this->language->get('error_option_value_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 438..446
                                admin/controller/tool/export_import.php on lines 458..466
                                admin/controller/tool/export_import.php on lines 468..476
                                admin/controller/tool/export_import.php on lines 478..486
                                admin/controller/tool/export_import.php on lines 488..496

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (empty($this->request->post['export_import_settings_use_attribute_id'])) {
                                            $attribute_names = $this->model_tool_export_import->getAttributeNameCounts();
                                            foreach ($attribute_names as $attribute_name) {
                                                if ($attribute_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $attribute_name['name'], $this->language->get('error_attribute_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 438..446
                                admin/controller/tool/export_import.php on lines 448..456
                                admin/controller/tool/export_import.php on lines 458..466
                                admin/controller/tool/export_import.php on lines 478..486
                                admin/controller/tool/export_import.php on lines 488..496

                                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 90.

                                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 6 locations. Consider refactoring.
                                Open

                                        if (empty($this->request->post['export_import_settings_use_filter_group_id'])) {
                                            $filter_group_names = $this->model_tool_export_import->getFilterGroupNameCounts();
                                            foreach ($filter_group_names as $filter_group_name) {
                                                if ($filter_group_name['count'] > 1) {
                                                    $this->error['warning'] = str_replace('%1', $filter_group_name['name'], $this->language->get('error_filter_group_name'));
                                Severity: Major
                                Found in admin/controller/tool/export_import.php and 5 other locations - About 30 mins to fix
                                admin/controller/tool/export_import.php on lines 438..446
                                admin/controller/tool/export_import.php on lines 448..456
                                admin/controller/tool/export_import.php on lines 458..466
                                admin/controller/tool/export_import.php on lines 468..476
                                admin/controller/tool/export_import.php on lines 488..496

                                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 90.

                                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

                                There are no issues that match your filters.

                                Category
                                Status