portainer/portainer

View on GitHub
app/kubernetes/__module.js

Summary

Maintainability
F
3 days
Test Coverage

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

import { EnvironmentStatus } from '@/react/portainer/environments/types';
import { getSelfSubjectAccessReview } from '@/react/kubernetes/namespaces/getSelfSubjectAccessReview';

import { updateAxiosAdapter } from '@/portainer/services/axios';
import { PortainerEndpointTypes } from 'Portainer/models/endpoint/models';
Severity: Major
Found in app/kubernetes/__module.js - About 1 day to fix

    Function onEnter has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          onEnter: /* @ngInject */ function onEnter(
            $async,
            $state,
            endpoint,
            KubernetesHealthService,
    Severity: Minor
    Found in app/kubernetes/__module.js - About 1 hr to fix

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

              $async,
              $state,
              endpoint,
              KubernetesHealthService,
              KubernetesNamespaceService,
      Severity: Major
      Found in app/kubernetes/__module.js - About 1 hr to fix

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

                  try {
                    if (endpoint.Type === PortainerEndpointTypes.EdgeAgentOnKubernetesEnvironment) {
                      //edge
                      try {
                        await KubernetesHealthService.ping(endpoint.Id);
        Severity: Major
        Found in app/kubernetes/__module.js and 1 other location - About 3 hrs to fix
        app/docker/__module.js on lines 28..50

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

        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

            const endpointKubernetesSecurityConstraint = {
              name: 'kubernetes.cluster.securityConstraint',
              url: '/securityConstraint',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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/portainer/__module.js on lines 105..117
        app/portainer/__module.js on lines 408..420

        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

            const applicationEdit = {
              name: 'kubernetes.applications.application.edit',
              url: '/edit',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 resourcePool = {
              name: 'kubernetes.resourcePools.resourcePool',
              url: '/:id',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 node = {
              name: 'kubernetes.cluster.node',
              url: '/:nodeName',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 endpointKubernetesConfiguration = {
              name: 'kubernetes.cluster.setup',
              url: '/configure',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 applications = {
              name: 'kubernetes.applications',
              url: '/applications',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 namespaceCreation = {
              name: 'kubernetes.resourcePools.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 ingresses = {
              name: 'kubernetes.ingresses',
              url: '/ingresses',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        app/kubernetes/__module.js on lines 134..145
        app/kubernetes/__module.js on lines 147..158
        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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 application = {
              name: 'kubernetes.applications.application',
              url: '/:namespace/:name?resource-type&tab',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 configMapCreation = {
              name: 'kubernetes.configmaps.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 volumes = {
              name: 'kubernetes.volumes',
              url: '/volumes',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 deploy = {
              name: 'kubernetes.deploy',
              url: '/deploy?templateId&referrer&tab&buildMethod&chartName',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 secretCreation = {
              name: 'kubernetes.secrets.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 cluster = {
              name: 'kubernetes.cluster',
              url: '/cluster',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 registries = {
              name: 'kubernetes.registries',
              url: '/registries',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 539..550
        app/kubernetes/custom-templates/index.js on lines 14..26
        app/portainer/__module.js on lines 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 resourcePools = {
              name: 'kubernetes.resourcePools',
              url: '/pools',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 ingressesCreate = {
              name: 'kubernetes.ingresses.create',
              url: '/add',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 services = {
              name: 'kubernetes.services',
              url: '/services',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        app/kubernetes/__module.js on lines 134..145
        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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 dashboard = {
              name: 'kubernetes.dashboard',
              url: '/dashboard',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 helmApplication = {
              name: 'kubernetes.helm',
              url: '/helm/:namespace/:name',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 applicationCreation = {
              name: 'kubernetes.applications.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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 resourcePoolAccess = {
              name: 'kubernetes.resourcePools.resourcePool.access',
              url: '/access',
              views: {
                'content@': {
        Severity: Major
        Found in app/kubernetes/__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 21..32
        app/edge/__module.js on lines 54..65
        app/edge/__module.js on lines 67..78
        app/edge/__module.js on lines 95..106
        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 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 177..188
        app/portainer/__module.js on lines 215..226
        app/portainer/__module.js on lines 318..329
        app/portainer/__module.js on lines 368..379
        app/portainer/__module.js on lines 381..392
        app/portainer/__module.js on lines 422..433

        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