portainer/portainer

View on GitHub

Showing 1,943 of 3,462 total issues

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

    const ingresses = {
      name: 'kubernetes.ingresses',
      url: '/ingresses',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const stacks = {
      name: 'edge.stacks',
      url: '/stacks',
      views: {
        'content@': {
Severity: Major
Found in app/edge/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 441..452
app/kubernetes/__module.js on lines 454..465
app/kubernetes/__module.js on lines 467..478
app/kubernetes/__module.js on lines 480..491
app/kubernetes/__module.js on lines 493..504
app/kubernetes/__module.js on lines 516..527
app/kubernetes/__module.js on lines 539..550
app/kubernetes/custom-templates/index.js on lines 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const configMapCreation = {
      name: 'kubernetes.configmaps.new',
      url: '/new',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const endpointKubernetesConfiguration = {
      name: 'kubernetes.cluster.setup',
      url: '/configure',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 441..452
app/kubernetes/__module.js on lines 454..465
app/kubernetes/__module.js on lines 467..478
app/kubernetes/__module.js on lines 480..491
app/kubernetes/__module.js on lines 493..504
app/kubernetes/__module.js on lines 516..527
app/kubernetes/custom-templates/index.js on lines 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

      const registryCreation = {
        name: 'portainer.registries.new',
        url: '/new',
        views: {
          'content@': {
Severity: Major
Found in app/portainer/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 441..452
app/kubernetes/__module.js on lines 454..465
app/kubernetes/__module.js on lines 467..478
app/kubernetes/__module.js on lines 480..491
app/kubernetes/__module.js on lines 493..504
app/kubernetes/__module.js on lines 516..527
app/kubernetes/__module.js on lines 539..550
app/kubernetes/custom-templates/index.js on lines 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const newFilePath = this.state.path === '/' ? newName : `${this.state.path}/${newName}`;
Severity: Major
Found in app/agent/components/volume-browser/volumeBrowserController.js and 3 other locations - About 35 mins to fix
app/agent/components/volume-browser/volumeBrowserController.js on lines 36..36
app/agent/components/volume-browser/volumeBrowserController.js on lines 49..49
app/agent/components/volume-browser/volumeBrowserController.js on lines 63..63

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

    const helmApplication = {
      name: 'kubernetes.helm',
      url: '/helm/:namespace/:name',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const cluster = {
      name: 'kubernetes.cluster',
      url: '/cluster',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const dashboard = {
      name: 'kubernetes.dashboard',
      url: '/dashboard',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

  onRegistriesChange(registries) {
    return this.$scope.$evalAsync(() => {
      this.formValues.Registries = registries;
    });
  }
app/kubernetes/views/resource-pools/create/createResourcePoolController.js on lines 42..46

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

    const resourcePools = {
      name: 'kubernetes.resourcePools',
      url: '/pools',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    $scope.addLabel = function () {
      $scope.formValues.Labels.push({
        key: '',
        value: '',
      });
Severity: Major
Found in app/docker/views/networks/create/createNetworkController.js and 7 other locations - About 35 mins to fix
app/docker/views/networks/create/createNetworkController.js on lines 63..68
app/docker/views/secrets/create/createSecretController.js on lines 34..36
app/docker/views/services/create/createServiceController.js on lines 196..198
app/docker/views/services/create/createServiceController.js on lines 204..206
app/docker/views/services/create/createServiceController.js on lines 212..214
app/docker/views/services/create/createServiceController.js on lines 220..222
app/docker/views/volumes/create/createVolumeController.js on lines 36..38

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

    $scope.addDriverOption = function () {
      $scope.formValues.DriverOptions.push({ name: '', value: '' });
    };
Severity: Major
Found in app/docker/views/volumes/create/createVolumeController.js and 7 other locations - About 35 mins to fix
app/docker/views/networks/create/createNetworkController.js on lines 63..68
app/docker/views/networks/create/createNetworkController.js on lines 74..79
app/docker/views/secrets/create/createSecretController.js on lines 34..36
app/docker/views/services/create/createServiceController.js on lines 196..198
app/docker/views/services/create/createServiceController.js on lines 204..206
app/docker/views/services/create/createServiceController.js on lines 212..214
app/docker/views/services/create/createServiceController.js on lines 220..222

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

  const customTemplates = {
    name: 'kubernetes.templates.custom',
    url: '/custom',

    views: {
Severity: Major
Found in app/kubernetes/custom-templates/index.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 441..452
app/kubernetes/__module.js on lines 454..465
app/kubernetes/__module.js on lines 467..478
app/kubernetes/__module.js on lines 480..491
app/kubernetes/__module.js on lines 493..504
app/kubernetes/__module.js on lines 516..527
app/kubernetes/__module.js on lines 539..550
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const applicationCreation = {
      name: 'kubernetes.applications.new',
      url: '/new',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const applicationEdit = {
      name: 'kubernetes.applications.application.edit',
      url: '/edit',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

      var home = {
        name: 'portainer.home',
        url: '/home?redirect&environmentId&environmentName&route',
        views: {
          'content@': {
Severity: Major
Found in app/portainer/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 441..452
app/kubernetes/__module.js on lines 454..465
app/kubernetes/__module.js on lines 467..478
app/kubernetes/__module.js on lines 480..491
app/kubernetes/__module.js on lines 493..504
app/kubernetes/__module.js on lines 516..527
app/kubernetes/__module.js on lines 539..550
app/kubernetes/custom-templates/index.js on lines 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const resourcePool = {
      name: 'kubernetes.resourcePools.resourcePool',
      url: '/:id',
      views: {
        'content@': {
Severity: Major
Found in app/kubernetes/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 66..77
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 441..452
app/kubernetes/__module.js on lines 454..465
app/kubernetes/__module.js on lines 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 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    const filePath = this.state.path === '/' ? file : `${this.state.path}/${file}`;
Severity: Major
Found in app/agent/components/volume-browser/volumeBrowserController.js and 3 other locations - About 35 mins to fix
app/agent/components/volume-browser/volumeBrowserController.js on lines 37..37
app/agent/components/volume-browser/volumeBrowserController.js on lines 49..49
app/agent/components/volume-browser/volumeBrowserController.js on lines 63..63

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

    const stacksNew = {
      name: 'edge.stacks.new',
      url: '/new?templateId&templateType',
      views: {
        'content@': {
Severity: Major
Found in app/edge/__module.js and 39 other locations - About 35 mins to fix
app/docker/__module.js on lines 112..124
app/docker/__module.js on lines 148..159
app/docker/__module.js on lines 161..172
app/docker/__module.js on lines 510..521
app/docker/__module.js on lines 573..584
app/docker/__module.js on lines 586..597
app/docker/__module.js on lines 599..610
app/docker/__module.js on lines 612..623
app/edge/__module.js on lines 20..31
app/edge/__module.js on lines 53..64
app/edge/__module.js on lines 94..105
app/kubernetes/__module.js on lines 134..145
app/kubernetes/__module.js on lines 147..158
app/kubernetes/__module.js on lines 160..171
app/kubernetes/__module.js on lines 173..184
app/kubernetes/__module.js on lines 196..207
app/kubernetes/__module.js on lines 209..220
app/kubernetes/__module.js on lines 222..233
app/kubernetes/__module.js on lines 235..246
app/kubernetes/__module.js on lines 324..335
app/kubernetes/__module.js on lines 356..367
app/kubernetes/__module.js on lines 379..390
app/kubernetes/__module.js on lines 392..403
app/kubernetes/__module.js on lines 415..426
app/kubernetes/__module.js on lines 428..439
app/kubernetes/__module.js on lines 441..452
app/kubernetes/__module.js on lines 454..465
app/kubernetes/__module.js on lines 467..478
app/kubernetes/__module.js on lines 480..491
app/kubernetes/__module.js on lines 493..504
app/kubernetes/__module.js on lines 516..527
app/kubernetes/__module.js on lines 539..550
app/kubernetes/custom-templates/index.js on lines 12..24
app/portainer/__module.js on lines 176..187
app/portainer/__module.js on lines 214..225
app/portainer/__module.js on lines 317..328
app/portainer/__module.js on lines 367..378
app/portainer/__module.js on lines 380..391
app/portainer/__module.js on lines 421..432

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language