luyadev/luya-module-cms

View on GitHub

Showing 326 of 326 total issues

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

            138 =>
            [
                    'id' => '138',
                    'nav_id' => '62',
                    'lang' => 'fr',
Severity: Major
Found in tests/src/menu/_dataFrArray.php and 21 other locations - About 3 hrs to fix
tests/src/menu/_dataFrArray.php on lines 703..734
tests/src/menu/_dataFrArray.php on lines 760..791
tests/src/menu/_dataFrArray.php on lines 792..823
tests/src/menu/_dataFrArray.php on lines 824..855
tests/src/menu/_dataFrArray.php on lines 856..887
tests/src/menu/_dataFrArray.php on lines 888..919
tests/src/menu/_dataFrArray.php on lines 920..951
tests/src/menu/_dataFrArray.php on lines 984..1015
tests/src/menu/_dataFrArray.php on lines 1016..1047
tests/src/menu/_dataFrArray.php on lines 1048..1079
tests/src/menu/_dataFrArray.php on lines 1080..1111
tests/src/menu/_dataFrArray.php on lines 1112..1143
tests/src/menu/_dataFrArray.php on lines 1144..1175
tests/src/menu/_dataFrArray.php on lines 1176..1207
tests/src/menu/_dataFrArray.php on lines 1208..1239
tests/src/menu/_dataFrArray.php on lines 1240..1271
tests/src/menu/_dataFrArray.php on lines 1272..1303
tests/src/menu/_dataFrArray.php on lines 1304..1335
tests/src/menu/_dataFrArray.php on lines 1336..1367
tests/src/menu/_dataFrArray.php on lines 1368..1399
tests/src/menu/_dataFrArray.php on lines 1400..1431

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

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

            147 =>
            [
                    'id' => '147',
                    'nav_id' => '74',
                    'lang' => 'fr',
Severity: Major
Found in tests/src/menu/_dataFrArray.php and 21 other locations - About 3 hrs to fix
tests/src/menu/_dataFrArray.php on lines 703..734
tests/src/menu/_dataFrArray.php on lines 760..791
tests/src/menu/_dataFrArray.php on lines 792..823
tests/src/menu/_dataFrArray.php on lines 824..855
tests/src/menu/_dataFrArray.php on lines 856..887
tests/src/menu/_dataFrArray.php on lines 888..919
tests/src/menu/_dataFrArray.php on lines 920..951
tests/src/menu/_dataFrArray.php on lines 952..983
tests/src/menu/_dataFrArray.php on lines 1016..1047
tests/src/menu/_dataFrArray.php on lines 1048..1079
tests/src/menu/_dataFrArray.php on lines 1080..1111
tests/src/menu/_dataFrArray.php on lines 1112..1143
tests/src/menu/_dataFrArray.php on lines 1144..1175
tests/src/menu/_dataFrArray.php on lines 1176..1207
tests/src/menu/_dataFrArray.php on lines 1208..1239
tests/src/menu/_dataFrArray.php on lines 1240..1271
tests/src/menu/_dataFrArray.php on lines 1272..1303
tests/src/menu/_dataFrArray.php on lines 1304..1335
tests/src/menu/_dataFrArray.php on lines 1336..1367
tests/src/menu/_dataFrArray.php on lines 1368..1399
tests/src/menu/_dataFrArray.php on lines 1400..1431

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

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

            142 =>
            [
                    'id' => '142',
                    'nav_id' => '68',
                    'lang' => 'fr',
Severity: Major
Found in tests/src/menu/_dataFrArray.php and 21 other locations - About 3 hrs to fix
tests/src/menu/_dataFrArray.php on lines 703..734
tests/src/menu/_dataFrArray.php on lines 760..791
tests/src/menu/_dataFrArray.php on lines 792..823
tests/src/menu/_dataFrArray.php on lines 824..855
tests/src/menu/_dataFrArray.php on lines 856..887
tests/src/menu/_dataFrArray.php on lines 888..919
tests/src/menu/_dataFrArray.php on lines 920..951
tests/src/menu/_dataFrArray.php on lines 952..983
tests/src/menu/_dataFrArray.php on lines 984..1015
tests/src/menu/_dataFrArray.php on lines 1016..1047
tests/src/menu/_dataFrArray.php on lines 1048..1079
tests/src/menu/_dataFrArray.php on lines 1080..1111
tests/src/menu/_dataFrArray.php on lines 1112..1143
tests/src/menu/_dataFrArray.php on lines 1144..1175
tests/src/menu/_dataFrArray.php on lines 1176..1207
tests/src/menu/_dataFrArray.php on lines 1208..1239
tests/src/menu/_dataFrArray.php on lines 1240..1271
tests/src/menu/_dataFrArray.php on lines 1272..1303
tests/src/menu/_dataFrArray.php on lines 1336..1367
tests/src/menu/_dataFrArray.php on lines 1368..1399
tests/src/menu/_dataFrArray.php on lines 1400..1431

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

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

            144 =>
            [
                    'id' => '144',
                    'nav_id' => '70',
                    'lang' => 'fr',
Severity: Major
Found in tests/src/menu/_dataFrArray.php and 21 other locations - About 3 hrs to fix
tests/src/menu/_dataFrArray.php on lines 703..734
tests/src/menu/_dataFrArray.php on lines 760..791
tests/src/menu/_dataFrArray.php on lines 792..823
tests/src/menu/_dataFrArray.php on lines 824..855
tests/src/menu/_dataFrArray.php on lines 856..887
tests/src/menu/_dataFrArray.php on lines 888..919
tests/src/menu/_dataFrArray.php on lines 920..951
tests/src/menu/_dataFrArray.php on lines 952..983
tests/src/menu/_dataFrArray.php on lines 984..1015
tests/src/menu/_dataFrArray.php on lines 1016..1047
tests/src/menu/_dataFrArray.php on lines 1048..1079
tests/src/menu/_dataFrArray.php on lines 1080..1111
tests/src/menu/_dataFrArray.php on lines 1112..1143
tests/src/menu/_dataFrArray.php on lines 1144..1175
tests/src/menu/_dataFrArray.php on lines 1176..1207
tests/src/menu/_dataFrArray.php on lines 1208..1239
tests/src/menu/_dataFrArray.php on lines 1240..1271
tests/src/menu/_dataFrArray.php on lines 1272..1303
tests/src/menu/_dataFrArray.php on lines 1304..1335
tests/src/menu/_dataFrArray.php on lines 1336..1367
tests/src/menu/_dataFrArray.php on lines 1400..1431

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

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

            145 =>
            [
                    'id' => '145',
                    'nav_id' => '71',
                    'lang' => 'fr',
Severity: Major
Found in tests/src/menu/_dataFrArray.php and 21 other locations - About 3 hrs to fix
tests/src/menu/_dataFrArray.php on lines 703..734
tests/src/menu/_dataFrArray.php on lines 760..791
tests/src/menu/_dataFrArray.php on lines 792..823
tests/src/menu/_dataFrArray.php on lines 824..855
tests/src/menu/_dataFrArray.php on lines 856..887
tests/src/menu/_dataFrArray.php on lines 888..919
tests/src/menu/_dataFrArray.php on lines 920..951
tests/src/menu/_dataFrArray.php on lines 952..983
tests/src/menu/_dataFrArray.php on lines 984..1015
tests/src/menu/_dataFrArray.php on lines 1016..1047
tests/src/menu/_dataFrArray.php on lines 1048..1079
tests/src/menu/_dataFrArray.php on lines 1080..1111
tests/src/menu/_dataFrArray.php on lines 1112..1143
tests/src/menu/_dataFrArray.php on lines 1144..1175
tests/src/menu/_dataFrArray.php on lines 1176..1207
tests/src/menu/_dataFrArray.php on lines 1208..1239
tests/src/menu/_dataFrArray.php on lines 1240..1271
tests/src/menu/_dataFrArray.php on lines 1272..1303
tests/src/menu/_dataFrArray.php on lines 1304..1335
tests/src/menu/_dataFrArray.php on lines 1336..1367
tests/src/menu/_dataFrArray.php on lines 1368..1399

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

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

            141 =>
            [
                    'id' => '141',
                    'nav_id' => '67',
                    'lang' => 'fr',
Severity: Major
Found in tests/src/menu/_dataFrArray.php and 21 other locations - About 3 hrs to fix
tests/src/menu/_dataFrArray.php on lines 703..734
tests/src/menu/_dataFrArray.php on lines 760..791
tests/src/menu/_dataFrArray.php on lines 792..823
tests/src/menu/_dataFrArray.php on lines 824..855
tests/src/menu/_dataFrArray.php on lines 856..887
tests/src/menu/_dataFrArray.php on lines 888..919
tests/src/menu/_dataFrArray.php on lines 920..951
tests/src/menu/_dataFrArray.php on lines 952..983
tests/src/menu/_dataFrArray.php on lines 984..1015
tests/src/menu/_dataFrArray.php on lines 1016..1047
tests/src/menu/_dataFrArray.php on lines 1048..1079
tests/src/menu/_dataFrArray.php on lines 1080..1111
tests/src/menu/_dataFrArray.php on lines 1112..1143
tests/src/menu/_dataFrArray.php on lines 1144..1175
tests/src/menu/_dataFrArray.php on lines 1176..1207
tests/src/menu/_dataFrArray.php on lines 1208..1239
tests/src/menu/_dataFrArray.php on lines 1240..1271
tests/src/menu/_dataFrArray.php on lines 1304..1335
tests/src/menu/_dataFrArray.php on lines 1336..1367
tests/src/menu/_dataFrArray.php on lines 1368..1399
tests/src/menu/_dataFrArray.php on lines 1400..1431

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

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

Function importLayoutFile has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    protected function importLayoutFile($file, $aliased, $themeName = null)
    {
        if (!file_exists($file)) {
            return false;
        }
Severity: Minor
Found in src/admin/importers/CmslayoutImporter.php - About 3 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 actionCreate has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function actionCreate()
    {
        if (empty($this->type)) {
            Console::clearScreenBeforeCursor();
            $this->type = $this->select('Do you want to create an app or module Block?', [
Severity: Minor
Found in src/frontend/commands/BlockController.php - About 3 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

InjectItem has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class InjectItem extends BaseObject implements InjectItemInterface
{
    /**
     * @var integer The user id who created this page.
     */
Severity: Minor
Found in src/menu/InjectItem.php - About 3 hrs to fix

    Method renderPlaceholderRecursive has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function renderPlaceholderRecursive($navItemPageId, $placeholderVar, $prevId, $layoutBlockInstance = null)
        {
            $string = '';
            $i = 0;
            $equalIndex = 1;
    Severity: Major
    Found in src/models/NavItemPage.php - About 3 hrs to fix

      Function renderItem has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public function renderItem($navItemId, $appendix = null, bool|int $setNavItemTypeId = false)
          {
              $model = NavItem::find()->where(['id' => $navItemId])->with(['nav'])->one();
      
              if (!$model) {
      Severity: Minor
      Found in src/frontend/base/Controller.php - About 3 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 testRegisterDefaultVariations has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testRegisterDefaultVariations()
          {
              $this->app->getModule('cmsadmin')->blockVariations = [
                  TestingBlock::variations()
                      ->add('idf', 'My Test')
      Severity: Major
      Found in tests/src/base/BlockVariationRegisterTest.php - About 3 hrs to fix

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

            public function testRenderPlaceholderIteration()
            {
                $this->app->setComponents([
                         'db' => [
                             'class' => 'yii\db\Connection',
        Severity: Major
        Found in tests/src/base/BlockPlaceholderIterationTest.php - About 3 hrs to fix

          File InternalBaseBlock.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace luya\cms\base;
          
          use luya\admin\base\TypesInterface;
          Severity: Minor
          Found in src/base/InternalBaseBlock.php - About 3 hrs to fix

            Method renderItem has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function renderItem($navItemId, $appendix = null, bool|int $setNavItemTypeId = false)
                {
                    $model = NavItem::find()->where(['id' => $navItemId])->with(['nav'])->one();
            
                    if (!$model) {
            Severity: Major
            Found in src/frontend/base/Controller.php - About 3 hrs to fix

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

                      $ctrl->config = [
                          'vars' => [
                              ['var' => 'foo', 'type' => 'self::TYPE_TEXT', 'label' => 'Foo'],
                              ['var' => 'bar', 'type' => 'self::TYPE_IMAGEUPLOAD', 'label' => 'Bar', 'options' => 'OPTIONS!'],
                          ],
              Severity: Major
              Found in tests/src/frontend/commands/BlockControllerTest.php and 1 other location - About 3 hrs to fix
              tests/src/frontend/commands/BlockControllerTest.php on lines 281..294

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

              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

                      $ctrl->config = [
                          'vars' => [
                              ['var' => 'foo', 'type' => 'self::TYPE_TEXT', 'label' => 'Foo'],
                              ['var' => 'bar', 'type' => 'self::TYPE_IMAGEUPLOAD', 'label' => 'Bar', 'options' => 'OPTIONS!'],
                          ],
              Severity: Major
              Found in tests/src/frontend/commands/BlockControllerTest.php and 1 other location - About 3 hrs to fix
              tests/src/frontend/commands/BlockControllerTest.php on lines 139..152

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

              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 testActionToggleHome has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function testActionToggleHome()
                  {
                      PermissionScope::run($this->app, function (PermissionScope $scope) {
                          $this->createAdminLangFixture();
                          $this->createCmsNavItemRedirectFixture();
              Severity: Major
              Found in tests/src/admin/apis/NavControllerTest.php - About 3 hrs to fix

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

                            } else if (dragged.hasOwnProperty('copystack')) {
                                // its a block from copy stack
                                $http.post('admin/api-cms-navitemblock/copy-block-from-stack', {
                                    copyBlockId: dragged.id,
                                    sort_index: 0,
                Severity: Major
                Found in src/admin/resources/js/cmsadmin.js and 1 other location - About 2 hrs to fix
                src/admin/resources/js/cmsadmin.js on lines 1459..1490

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

                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

                            if (dragged.hasOwnProperty('favorized') || dragged.hasOwnProperty('newblock')) {
                                // its a new block
                                $http.post('admin/api-cms-navitempageblockitem/create', {
                                    prev_id: dropped.prev_id, 
                                    sort_index:0, 
                Severity: Major
                Found in src/admin/resources/js/cmsadmin.js and 1 other location - About 2 hrs to fix
                src/admin/resources/js/cmsadmin.js on lines 1470..1490

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

                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

                Severity
                Category
                Status
                Source
                Language