portainer/portainer

View on GitHub
app/portainer/__module.js

Summary

Maintainability
D
2 days
Test Coverage

File __module.js has 480 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import featureFlagModule from '@/react/portainer/feature-flags';

import './rbac';

import componentsModule from './components';
Severity: Minor
Found in app/portainer/__module.js - About 7 hrs to fix

    Function endpoint has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

              endpoint: /* @ngInject */ function endpoint($async, $state, $transition$, EndpointProvider, EndpointService, Notifications) {
    Severity: Minor
    Found in app/portainer/__module.js - About 45 mins to fix

      Function onEnter has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              onEnter: /* @ngInject */ function onEnter($async, StateManager, Authentication, Notifications, $state) {
      Severity: Minor
      Found in app/portainer/__module.js - About 35 mins to fix

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

              var groups = {
                name: 'portainer.groups',
                url: '/groups',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 3 other locations - About 1 hr to fix
        app/portainer/__module.js on lines 353..365
        app/portainer/__module.js on lines 393..405
        app/portainer/rbac/index.js on lines 19..31

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

        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

              var settings = {
                name: 'portainer.settings',
                url: '/settings',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 3 other locations - About 1 hr to fix
        app/portainer/__module.js on lines 270..282
        app/portainer/__module.js on lines 353..365
        app/portainer/rbac/index.js on lines 19..31

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

        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

              var registries = {
                name: 'portainer.registries',
                url: '/registries',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 3 other locations - About 1 hr to fix
        app/portainer/__module.js on lines 270..282
        app/portainer/__module.js on lines 393..405
        app/portainer/rbac/index.js on lines 19..31

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

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

              var account = {
                name: 'portainer.account',
                url: '/account',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 18 other locations - About 50 mins to fix
        app/docker/__module.js on lines 148..160
        app/docker/__module.js on lines 185..197
        app/docker/__module.js on lines 199..211
        app/docker/__module.js on lines 224..236
        app/docker/__module.js on lines 238..250
        app/docker/__module.js on lines 252..264
        app/docker/__module.js on lines 276..288
        app/docker/__module.js on lines 319..331
        app/docker/__module.js on lines 344..356
        app/docker/__module.js on lines 358..370
        app/docker/__module.js on lines 383..395
        app/docker/__module.js on lines 408..420
        app/docker/__module.js on lines 455..467
        app/docker/__module.js on lines 469..481
        app/docker/__module.js on lines 524..536
        app/docker/__module.js on lines 560..572
        app/kubernetes/__module.js on lines 552..564
        app/portainer/__module.js on lines 407..419

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

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

              var settingsAuthentication = {
                name: 'portainer.settings.authentication',
                url: '/auth',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 18 other locations - About 50 mins to fix
        app/docker/__module.js on lines 148..160
        app/docker/__module.js on lines 185..197
        app/docker/__module.js on lines 199..211
        app/docker/__module.js on lines 224..236
        app/docker/__module.js on lines 238..250
        app/docker/__module.js on lines 252..264
        app/docker/__module.js on lines 276..288
        app/docker/__module.js on lines 319..331
        app/docker/__module.js on lines 344..356
        app/docker/__module.js on lines 358..370
        app/docker/__module.js on lines 383..395
        app/docker/__module.js on lines 408..420
        app/docker/__module.js on lines 455..467
        app/docker/__module.js on lines 469..481
        app/docker/__module.js on lines 524..536
        app/docker/__module.js on lines 560..572
        app/kubernetes/__module.js on lines 552..564
        app/portainer/__module.js on lines 104..116

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

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

              var home = {
                name: 'portainer.home',
                url: '/home?redirect&environmentId&environmentName&route',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 38 other locations - About 35 mins to fix
        app/docker/__module.js on lines 112..124
        app/docker/__module.js on lines 162..173
        app/docker/__module.js on lines 511..522
        app/docker/__module.js on lines 574..585
        app/docker/__module.js on lines 587..598
        app/docker/__module.js on lines 600..611
        app/docker/__module.js on lines 613..624
        app/edge/__module.js on lines 20..31
        app/edge/__module.js on lines 53..64
        app/edge/__module.js on lines 66..77
        app/edge/__module.js on lines 94..105
        app/kubernetes/__module.js on lines 134..145
        app/kubernetes/__module.js on lines 147..158
        app/kubernetes/__module.js on lines 160..171
        app/kubernetes/__module.js on lines 173..184
        app/kubernetes/__module.js on lines 196..207
        app/kubernetes/__module.js on lines 209..220
        app/kubernetes/__module.js on lines 222..233
        app/kubernetes/__module.js on lines 235..246
        app/kubernetes/__module.js on lines 324..335
        app/kubernetes/__module.js on lines 356..367
        app/kubernetes/__module.js on lines 379..390
        app/kubernetes/__module.js on lines 392..403
        app/kubernetes/__module.js on lines 415..426
        app/kubernetes/__module.js on lines 428..439
        app/kubernetes/__module.js on lines 441..452
        app/kubernetes/__module.js on lines 454..465
        app/kubernetes/__module.js on lines 467..478
        app/kubernetes/__module.js on lines 480..491
        app/kubernetes/__module.js on lines 493..504
        app/kubernetes/__module.js on lines 516..527
        app/kubernetes/__module.js on lines 539..550
        app/kubernetes/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 176..187
        app/portainer/__module.js on lines 214..225
        app/portainer/__module.js on lines 367..378
        app/portainer/__module.js on lines 380..391
        app/portainer/__module.js on lines 421..432

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

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

              var registry = {
                name: 'portainer.registries.registry',
                url: '/:id',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 38 other locations - About 35 mins to fix
        app/docker/__module.js on lines 112..124
        app/docker/__module.js on lines 162..173
        app/docker/__module.js on lines 511..522
        app/docker/__module.js on lines 574..585
        app/docker/__module.js on lines 587..598
        app/docker/__module.js on lines 600..611
        app/docker/__module.js on lines 613..624
        app/edge/__module.js on lines 20..31
        app/edge/__module.js on lines 53..64
        app/edge/__module.js on lines 66..77
        app/edge/__module.js on lines 94..105
        app/kubernetes/__module.js on lines 134..145
        app/kubernetes/__module.js on lines 147..158
        app/kubernetes/__module.js on lines 160..171
        app/kubernetes/__module.js on lines 173..184
        app/kubernetes/__module.js on lines 196..207
        app/kubernetes/__module.js on lines 209..220
        app/kubernetes/__module.js on lines 222..233
        app/kubernetes/__module.js on lines 235..246
        app/kubernetes/__module.js on lines 324..335
        app/kubernetes/__module.js on lines 356..367
        app/kubernetes/__module.js on lines 379..390
        app/kubernetes/__module.js on lines 392..403
        app/kubernetes/__module.js on lines 415..426
        app/kubernetes/__module.js on lines 428..439
        app/kubernetes/__module.js on lines 441..452
        app/kubernetes/__module.js on lines 454..465
        app/kubernetes/__module.js on lines 467..478
        app/kubernetes/__module.js on lines 480..491
        app/kubernetes/__module.js on lines 493..504
        app/kubernetes/__module.js on lines 516..527
        app/kubernetes/__module.js on lines 539..550
        app/kubernetes/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 176..187
        app/portainer/__module.js on lines 214..225
        app/portainer/__module.js on lines 317..328
        app/portainer/__module.js on lines 380..391
        app/portainer/__module.js on lines 421..432

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

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

              var settingsEdgeCompute = {
                name: 'portainer.settings.edgeCompute',
                url: '/edge',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 38 other locations - About 35 mins to fix
        app/docker/__module.js on lines 112..124
        app/docker/__module.js on lines 162..173
        app/docker/__module.js on lines 511..522
        app/docker/__module.js on lines 574..585
        app/docker/__module.js on lines 587..598
        app/docker/__module.js on lines 600..611
        app/docker/__module.js on lines 613..624
        app/edge/__module.js on lines 20..31
        app/edge/__module.js on lines 53..64
        app/edge/__module.js on lines 66..77
        app/edge/__module.js on lines 94..105
        app/kubernetes/__module.js on lines 134..145
        app/kubernetes/__module.js on lines 147..158
        app/kubernetes/__module.js on lines 160..171
        app/kubernetes/__module.js on lines 173..184
        app/kubernetes/__module.js on lines 196..207
        app/kubernetes/__module.js on lines 209..220
        app/kubernetes/__module.js on lines 222..233
        app/kubernetes/__module.js on lines 235..246
        app/kubernetes/__module.js on lines 324..335
        app/kubernetes/__module.js on lines 356..367
        app/kubernetes/__module.js on lines 379..390
        app/kubernetes/__module.js on lines 392..403
        app/kubernetes/__module.js on lines 415..426
        app/kubernetes/__module.js on lines 428..439
        app/kubernetes/__module.js on lines 441..452
        app/kubernetes/__module.js on lines 454..465
        app/kubernetes/__module.js on lines 467..478
        app/kubernetes/__module.js on lines 480..491
        app/kubernetes/__module.js on lines 493..504
        app/kubernetes/__module.js on lines 516..527
        app/kubernetes/__module.js on lines 539..550
        app/kubernetes/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 176..187
        app/portainer/__module.js on lines 214..225
        app/portainer/__module.js on lines 317..328
        app/portainer/__module.js on lines 367..378
        app/portainer/__module.js on lines 380..391

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

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

              const registryCreation = {
                name: 'portainer.registries.new',
                url: '/new',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 38 other locations - About 35 mins to fix
        app/docker/__module.js on lines 112..124
        app/docker/__module.js on lines 162..173
        app/docker/__module.js on lines 511..522
        app/docker/__module.js on lines 574..585
        app/docker/__module.js on lines 587..598
        app/docker/__module.js on lines 600..611
        app/docker/__module.js on lines 613..624
        app/edge/__module.js on lines 20..31
        app/edge/__module.js on lines 53..64
        app/edge/__module.js on lines 66..77
        app/edge/__module.js on lines 94..105
        app/kubernetes/__module.js on lines 134..145
        app/kubernetes/__module.js on lines 147..158
        app/kubernetes/__module.js on lines 160..171
        app/kubernetes/__module.js on lines 173..184
        app/kubernetes/__module.js on lines 196..207
        app/kubernetes/__module.js on lines 209..220
        app/kubernetes/__module.js on lines 222..233
        app/kubernetes/__module.js on lines 235..246
        app/kubernetes/__module.js on lines 324..335
        app/kubernetes/__module.js on lines 356..367
        app/kubernetes/__module.js on lines 379..390
        app/kubernetes/__module.js on lines 392..403
        app/kubernetes/__module.js on lines 415..426
        app/kubernetes/__module.js on lines 428..439
        app/kubernetes/__module.js on lines 441..452
        app/kubernetes/__module.js on lines 454..465
        app/kubernetes/__module.js on lines 467..478
        app/kubernetes/__module.js on lines 480..491
        app/kubernetes/__module.js on lines 493..504
        app/kubernetes/__module.js on lines 516..527
        app/kubernetes/__module.js on lines 539..550
        app/kubernetes/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 176..187
        app/portainer/__module.js on lines 214..225
        app/portainer/__module.js on lines 317..328
        app/portainer/__module.js on lines 367..378
        app/portainer/__module.js on lines 421..432

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

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

              const edgeAutoCreateScript = {
                name: 'portainer.endpoints.edgeAutoCreateScript',
                url: '/aeec',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 38 other locations - About 35 mins to fix
        app/docker/__module.js on lines 112..124
        app/docker/__module.js on lines 162..173
        app/docker/__module.js on lines 511..522
        app/docker/__module.js on lines 574..585
        app/docker/__module.js on lines 587..598
        app/docker/__module.js on lines 600..611
        app/docker/__module.js on lines 613..624
        app/edge/__module.js on lines 20..31
        app/edge/__module.js on lines 53..64
        app/edge/__module.js on lines 66..77
        app/edge/__module.js on lines 94..105
        app/kubernetes/__module.js on lines 134..145
        app/kubernetes/__module.js on lines 147..158
        app/kubernetes/__module.js on lines 160..171
        app/kubernetes/__module.js on lines 173..184
        app/kubernetes/__module.js on lines 196..207
        app/kubernetes/__module.js on lines 209..220
        app/kubernetes/__module.js on lines 222..233
        app/kubernetes/__module.js on lines 235..246
        app/kubernetes/__module.js on lines 324..335
        app/kubernetes/__module.js on lines 356..367
        app/kubernetes/__module.js on lines 379..390
        app/kubernetes/__module.js on lines 392..403
        app/kubernetes/__module.js on lines 415..426
        app/kubernetes/__module.js on lines 428..439
        app/kubernetes/__module.js on lines 441..452
        app/kubernetes/__module.js on lines 454..465
        app/kubernetes/__module.js on lines 467..478
        app/kubernetes/__module.js on lines 480..491
        app/kubernetes/__module.js on lines 493..504
        app/kubernetes/__module.js on lines 516..527
        app/kubernetes/__module.js on lines 539..550
        app/kubernetes/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 176..187
        app/portainer/__module.js on lines 317..328
        app/portainer/__module.js on lines 367..378
        app/portainer/__module.js on lines 380..391
        app/portainer/__module.js on lines 421..432

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

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

              var endpoints = {
                name: 'portainer.endpoints',
                url: '/endpoints',
                views: {
                  'content@': {
        Severity: Major
        Found in app/portainer/__module.js and 38 other locations - About 35 mins to fix
        app/docker/__module.js on lines 112..124
        app/docker/__module.js on lines 162..173
        app/docker/__module.js on lines 511..522
        app/docker/__module.js on lines 574..585
        app/docker/__module.js on lines 587..598
        app/docker/__module.js on lines 600..611
        app/docker/__module.js on lines 613..624
        app/edge/__module.js on lines 20..31
        app/edge/__module.js on lines 53..64
        app/edge/__module.js on lines 66..77
        app/edge/__module.js on lines 94..105
        app/kubernetes/__module.js on lines 134..145
        app/kubernetes/__module.js on lines 147..158
        app/kubernetes/__module.js on lines 160..171
        app/kubernetes/__module.js on lines 173..184
        app/kubernetes/__module.js on lines 196..207
        app/kubernetes/__module.js on lines 209..220
        app/kubernetes/__module.js on lines 222..233
        app/kubernetes/__module.js on lines 235..246
        app/kubernetes/__module.js on lines 324..335
        app/kubernetes/__module.js on lines 356..367
        app/kubernetes/__module.js on lines 379..390
        app/kubernetes/__module.js on lines 392..403
        app/kubernetes/__module.js on lines 415..426
        app/kubernetes/__module.js on lines 428..439
        app/kubernetes/__module.js on lines 441..452
        app/kubernetes/__module.js on lines 454..465
        app/kubernetes/__module.js on lines 467..478
        app/kubernetes/__module.js on lines 480..491
        app/kubernetes/__module.js on lines 493..504
        app/kubernetes/__module.js on lines 516..527
        app/kubernetes/__module.js on lines 539..550
        app/kubernetes/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 214..225
        app/portainer/__module.js on lines 317..328
        app/portainer/__module.js on lines 367..378
        app/portainer/__module.js on lines 380..391
        app/portainer/__module.js on lines 421..432

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

        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