luyadev/luya-module-cms

View on GitHub

Showing 117 of 326 total issues

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

            return $q(function(resolve, reject) {

                if ($scope.data.nav_item_type == 1) {
                    $http.post('admin/api-cms-nav/create-page', $.param($scope.data), headers).then(function(response) {
                        resolve(response.data);
Severity: Major
Found in src/admin/resources/js/cmsadmin.js and 1 other location - About 1 day to fix
src/admin/resources/js/cmsadmin.js on lines 845..870

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

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

            return $q(function(resolve, reject) {

                if ($scope.data.nav_item_type == 1) {
                    $http.post('admin/api-cms-nav/create-page-item', $.param($scope.data), headers).then(function(response) {
                        resolve(response.data);
Severity: Major
Found in src/admin/resources/js/cmsadmin.js and 1 other location - About 1 day to fix
src/admin/resources/js/cmsadmin.js on lines 802..827

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

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

zaa.factory("ServiceLayoutsData", ['$http', '$q', '$rootScope', function($http, $q, $rootScope) {
    var service = [];
    
    service.data = [];
    
Severity: Major
Found in src/admin/resources/js/services.js and 2 other locations - About 7 hrs to fix
src/admin/resources/js/services.js on lines 78..98
src/admin/resources/js/services.js on lines 115..135

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

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

zaa.factory("ServiceBlocksData", ['$http', '$q', '$rootScope', function($http, $q, $rootScope) {
    var service = [];
    
    service.data = [];
    
Severity: Major
Found in src/admin/resources/js/services.js and 2 other locations - About 7 hrs to fix
src/admin/resources/js/services.js on lines 78..98
src/admin/resources/js/services.js on lines 151..171

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

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

zaa.factory("ServiceMenuData", ['$http', '$q', '$rootScope', function($http, $q, $rootScope) {
    var service = [];
    
    service.data = [];
    
Severity: Major
Found in src/admin/resources/js/services.js and 2 other locations - About 7 hrs to fix
src/admin/resources/js/services.js on lines 115..135
src/admin/resources/js/services.js on lines 151..171

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

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

                $scope.$watch(function() { return $scope.navData.is_hidden }, function(n, o) {
                    if (n !== o && n !== undefined) {
                        $http.get('admin/api-cms-nav/toggle-hidden', { params : { navId : $scope.navData.id , hiddenStatus : n }}).then(function(response) {
                            if ($scope.navData.is_hidden == 1) {
                                AdminToastService.info(i18nParam('js_state_hidden', {title: $scope.navData.title}));
Severity: Major
Found in src/admin/resources/js/cmsadmin.js and 1 other location - About 7 hrs to fix
src/admin/resources/js/cmsadmin.js on lines 1095..1105

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

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

                $scope.$watch(function() { return $scope.navData.is_offline }, function(n, o) {
                    if (n !== o && n !== undefined) {
                        $http.get('admin/api-cms-nav/toggle-offline', { params : { navId : $scope.navData.id , offlineStatus : n }}).then(function(response) {
                            if ($scope.navData.is_offline == 1) {
                                AdminToastService.info(i18nParam('js_state_offline', {title: $scope.navData.title}));
Severity: Major
Found in src/admin/resources/js/cmsadmin.js and 1 other location - About 7 hrs to fix
src/admin/resources/js/cmsadmin.js on lines 1107..1117

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

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

    public function testCountLangaugeAsSubCompare()
    {
        $this->assertEquals(1, count((new Query())->where(['nav_id' => 10])->lang('en')->one()->parents));
        //$this->assertEquals(1, count((new Query())->where(['nav_id' => 10])->lang('de')->one()->parents));

Severity: Major
Found in tests/src/menu/ItemTest.php and 4 other locations - About 5 hrs to fix
tests/src/menu/ItemTest.php on lines 172..185
tests/src/menu/ItemTest.php on lines 202..215
tests/src/menu/ItemTest.php on lines 232..245
tests/src/menu/ItemTest.php on lines 247..260

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

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

    public function testCountLangaugeCompare()
    {
        $this->assertEquals(0, count((new Query())->where(['nav_id' => 1])->lang('en')->one()->parents));
        //$this->assertEquals(0, count((new Query())->where(['nav_id' => 1])->lang('de')->one()->parents));

Severity: Major
Found in tests/src/menu/ItemTest.php and 4 other locations - About 5 hrs to fix
tests/src/menu/ItemTest.php on lines 187..200
tests/src/menu/ItemTest.php on lines 202..215
tests/src/menu/ItemTest.php on lines 232..245
tests/src/menu/ItemTest.php on lines 247..260

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

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

    public function testCountLangaugeAsPageWithChildrenCompare()
    {
        $this->assertEquals(0, count((new Query())->where(['nav_id' => 3])->lang('en')->one()->parents));
        //$this->assertEquals(0, count((new Query())->where(['nav_id' => 3])->lang('de')->one()->parents));

Severity: Major
Found in tests/src/menu/ItemTest.php and 4 other locations - About 5 hrs to fix
tests/src/menu/ItemTest.php on lines 172..185
tests/src/menu/ItemTest.php on lines 187..200
tests/src/menu/ItemTest.php on lines 232..245
tests/src/menu/ItemTest.php on lines 247..260

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

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

    public function testCountLangaugeAsPageWithChildrenCompareAsMenuFindOne()
    {
        $this->assertEquals(0, count((new Query())->where(['nav_id' => 3])->lang('en')->one()->parents));
        //$this->assertEquals(0, count((new Query())->where(['nav_id' => 3])->lang('de')->one()->parents));

Severity: Major
Found in tests/src/menu/ItemTest.php and 4 other locations - About 5 hrs to fix
tests/src/menu/ItemTest.php on lines 172..185
tests/src/menu/ItemTest.php on lines 187..200
tests/src/menu/ItemTest.php on lines 202..215
tests/src/menu/ItemTest.php on lines 232..245

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

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

    public function testCountLangaugeAsSubCompareAsMenuFindOne()
    {
        $this->assertEquals(1, count((new Query())->where(['nav_id' => 10])->lang('en')->one()->parents));
        //$this->assertEquals(1, count((new Query())->where(['nav_id' => 10])->lang('de')->one()->parents));

Severity: Major
Found in tests/src/menu/ItemTest.php and 4 other locations - About 5 hrs to fix
tests/src/menu/ItemTest.php on lines 172..185
tests/src/menu/ItemTest.php on lines 187..200
tests/src/menu/ItemTest.php on lines 202..215
tests/src/menu/ItemTest.php on lines 247..260

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

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

        $blockItemFixture = new NgRestModelFixture([
            'modelClass' => NavItemPageBlockItem::class,
            'fixtureData' => [
                'item1' => [
                    'id' => 1,
Severity: Major
Found in tests/src/base/BlockPlaceholderIterationTest.php and 1 other location - About 4 hrs to fix
tests/src/base/BlockPlaceholderIterationTest.php on lines 138..175

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

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

        $blockItemFixture = new NgRestModelFixture([
            'modelClass' => NavItemPageBlockItem::class,
            'fixtureData' => [
                'item1' => [
                    'id' => 1,
Severity: Major
Found in tests/src/base/BlockPlaceholderIterationTest.php and 1 other location - About 4 hrs to fix
tests/src/base/BlockPlaceholderIterationTest.php on lines 55..92

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

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

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

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

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

Refactorings

Further Reading

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

<?php

namespace cmstests\data\blocks\import;

use luya\cms\base\PhpBlock;
Severity: Major
Found in tests/data/blocks/import/TestBlock.php and 1 other location - About 3 hrs to fix
tests/data/blocks/TestBlock.php on lines 1..43

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

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

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

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

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

Refactorings

Further Reading

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

<?php

namespace cmstests\data\blocks;

use luya\cms\base\PhpBlock;
Severity: Major
Found in tests/data/blocks/TestBlock.php and 1 other location - About 3 hrs to fix
tests/data/blocks/import/TestBlock.php on lines 1..43

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

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

            130 =>
            [
                    'id' => '130',
                    'nav_id' => '54',
                    '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 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
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

            140 =>
            [
                    'id' => '140',
                    'nav_id' => '66',
                    '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 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

            139 =>
            [
                    'id' => '139',
                    'nav_id' => '65',
                    '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 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

Severity
Category
Status
Source
Language