portainer/portainer

View on GitHub
app/docker/__module.js

Summary

Maintainability
F
4 days
Test Coverage

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

import angular from 'angular';

import { PortainerEndpointTypes } from 'Portainer/models/endpoint/models';

import { EnvironmentStatus } from '@/react/portainer/environments/types';
Severity: Major
Found in app/docker/__module.js - About 1 day to fix

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

          onEnter: /* @ngInject */ function onEnter(endpoint, $async, $state, EndpointService, Notifications, StateManager, SystemService) {
            return $async(async () => {
              const dockerTypes = [PortainerEndpointTypes.DockerEnvironment, PortainerEndpointTypes.AgentOnDockerEnvironment, PortainerEndpointTypes.EdgeAgentOnDockerEnvironment];
    
              if (!dockerTypes.includes(endpoint.Type)) {
    Severity: Minor
    Found in app/docker/__module.js - About 1 hr to fix

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

            onEnter: /* @ngInject */ function onEnter(endpoint, $async, $state, EndpointService, Notifications, StateManager, SystemService) {
      Severity: Major
      Found in app/docker/__module.js - About 50 mins to fix

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

                  try {
                    const status = await checkEndpointStatus(endpoint);
        
                    if (endpoint.Type !== PortainerEndpointTypes.EdgeAgentOnDockerEnvironment) {
                      await updateEndpointStatus(endpoint, status);
        Severity: Major
        Found in app/docker/__module.js and 1 other location - About 3 hrs to fix
        app/kubernetes/__module.js on lines 96..129

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

            var configCreation = {
              name: 'docker.configs.new',
              url: '/new?id',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__module.js and 1 other location - About 1 hr to fix
        app/docker/__module.js on lines 71..84

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

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

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

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

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

        Refactorings

        Further Reading

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

            var configs = {
              name: 'docker.configs',
              url: '/configs',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__module.js and 1 other location - About 1 hr to fix
        app/docker/__module.js on lines 97..110

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

        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 networkCreation = {
              name: 'docker.networks.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var secretCreation = {
              name: 'docker.secrets.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var volumeCreation = {
              name: 'docker.volumes.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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/kubernetes/__module.js on lines 552..564
        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 19 locations. Consider refactoring.
        Open

            var imageImport = {
              name: 'docker.images.import',
              url: '/import',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var serviceCreation = {
              name: 'docker.services.new',
              url: '/new',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var secrets = {
              name: 'docker.secrets',
              url: '/secrets',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var stacks = {
              name: 'docker.stacks',
              url: '/stacks',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var networks = {
              name: 'docker.networks',
              url: '/networks',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var events = {
              name: 'docker.events',
              url: '/events',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var dashboard = {
              name: 'docker.dashboard',
              url: '/dashboard',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__module.js and 18 other locations - About 50 mins to fix
        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 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 19 locations. Consider refactoring.
        Open

            var volumes = {
              name: 'docker.volumes',
              url: '/volumes',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 560..572
        app/kubernetes/__module.js on lines 552..564
        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 19 locations. Consider refactoring.
        Open

            var swarm = {
              name: 'docker.swarm',
              url: '/swarm',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var imageBuild = {
              name: 'docker.images.build',
              url: '/build',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var swarmVisualizer = {
              name: 'docker.swarm.visualizer',
              url: '/visualizer',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 524..536
        app/docker/__module.js on lines 560..572
        app/kubernetes/__module.js on lines 552..564
        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 19 locations. Consider refactoring.
        Open

            var images = {
              name: 'docker.images',
              url: '/images',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 19 locations. Consider refactoring.
        Open

            var services = {
              name: 'docker.services',
              url: '/services',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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 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 swarmFeaturesConfiguration = {
              name: 'docker.swarm.featuresConfiguration',
              url: '/feat-config',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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/__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 dockerRegistries = {
              name: 'docker.host.registries',
              url: '/registries',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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/__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

            var templates = {
              name: 'docker.templates',
              url: '/templates?template',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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/__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 swarmRegistries = {
              name: 'docker.swarm.registries',
              url: '/registries',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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/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/__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 customTemplates = {
              name: 'docker.templates.custom',
              url: '/custom',
        
              views: {
        Severity: Major
        Found in app/docker/__module.js and 38 other locations - About 35 mins to fix
        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/__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

            var host = {
              name: 'docker.host',
              url: '/host',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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/__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 dockerFeaturesConfiguration = {
              name: 'docker.host.featuresConfiguration',
              url: '/feat-config',
              views: {
                'content@': {
        Severity: Major
        Found in app/docker/__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 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/__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