protected/modules/store/StoreModule.php

Summary

Maintainability
F
3 days
Test Coverage

File StoreModule.php has 498 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use yupe\components\WebModule;

/**
Severity: Minor
Found in protected/modules/store/StoreModule.php - About 7 hrs to fix

    Method getAuthItems has 169 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getAuthItems()
        {
            return [
                [
                    'type' => AuthItem::TYPE_ROLE,
    Severity: Major
    Found in protected/modules/store/StoreModule.php - About 6 hrs to fix

      Method getNavigation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getNavigation()
          {
              return [
                  [
                      'icon' => 'fa fa-fw fa-reorder',
      Severity: Major
      Found in protected/modules/store/StoreModule.php - About 3 hrs to fix

        StoreModule has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class StoreModule extends WebModule
        {
            /**
             *
             */
        Severity: Minor
        Found in protected/modules/store/StoreModule.php - About 2 hrs to fix

          Method getEditableParamsGroups has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getEditableParamsGroups()
              {
                  return [
                      '0.store' => [
                          'label' => Yii::t('StoreModule.store', 'Store'),
          Severity: Minor
          Found in protected/modules/store/StoreModule.php - About 1 hr to fix

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

                        [
                            'icon' => 'fa fa-fw fa-plane',
                            'label' => Yii::t('StoreModule.store', 'Producers'),
                            'url' => ['/store/producerBackend/index'],
                            'items' => [
            Severity: Major
            Found in protected/modules/store/StoreModule.php and 3 other locations - About 1 hr to fix
            protected/modules/store/StoreModule.php on lines 323..339
            protected/modules/store/StoreModule.php on lines 357..373
            protected/modules/store/StoreModule.php on lines 374..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 105.

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

                        [
                            'icon' => 'fa fa-fw fa-pencil-square-o',
                            'label' => Yii::t('StoreModule.store', 'Attributes'),
                            'url' => ['/store/attributeBackend/index'],
                            'items' => [
            Severity: Major
            Found in protected/modules/store/StoreModule.php and 3 other locations - About 1 hr to fix
            protected/modules/store/StoreModule.php on lines 323..339
            protected/modules/store/StoreModule.php on lines 340..356
            protected/modules/store/StoreModule.php on lines 374..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 105.

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

                        [
                            'icon' => 'fa fa-fw fa-list-alt',
                            'label' => Yii::t('StoreModule.store', 'Types'),
                            'url' => ['/store/typeBackend/index'],
                            'items' => [
            Severity: Major
            Found in protected/modules/store/StoreModule.php and 3 other locations - About 1 hr to fix
            protected/modules/store/StoreModule.php on lines 323..339
            protected/modules/store/StoreModule.php on lines 340..356
            protected/modules/store/StoreModule.php on lines 357..373

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

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

                        [
                            'icon' => 'fa fa-fw fa-folder-open',
                            'label' => Yii::t('StoreModule.store', 'Categories'),
                            'url' => ['/store/categoryBackend/index'],
                            'items' => [
            Severity: Major
            Found in protected/modules/store/StoreModule.php and 3 other locations - About 1 hr to fix
            protected/modules/store/StoreModule.php on lines 340..356
            protected/modules/store/StoreModule.php on lines 357..373
            protected/modules/store/StoreModule.php on lines 374..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 105.

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

                public function getSortList()
                {
                    return [
                        'position' => Yii::t('StoreModule.store', 'Position'),
                        'sku' => Yii::t('StoreModule.store', 'SKU'),
            Severity: Major
            Found in protected/modules/store/StoreModule.php and 2 other locations - About 55 mins to fix
            protected/modules/blog/models/UserToBlog.php on lines 152..168
            protected/modules/order/OrderModule.php on lines 76..86

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

            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