NLeSC/Cesium-NcWMS

View on GitHub

Showing 81 of 81 total issues

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

      Messagebus.subscribe('ncwmsPaletteSelected', function(event, value) {
        if (this.selectedPalette !== value) {
          this.selectedPalette = value;
        }
      }.bind(this));
Severity: Minor
Found in app/scripts/customgraph/customgraph.controller.js and 1 other location - About 55 mins to fix
app/scripts/dataset/dataset.controller.js on lines 12..16

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

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

    Messagebus.subscribe('legendMaxChange', function(event, value) {
      this.legendMax = value;
      this.setLegendText();
    }.bind(this));
Severity: Minor
Found in app/scripts/biglegend/biglegend.controller.js and 1 other location - About 50 mins to fix
app/scripts/biglegend/biglegend.controller.js on lines 18..21

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

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

    Messagebus.subscribe('legendMinChange', function(event, value) {
      this.legendMin = value;
      this.setLegendText();
    }.bind(this));
Severity: Minor
Found in app/scripts/biglegend/biglegend.controller.js and 1 other location - About 50 mins to fix
app/scripts/biglegend/biglegend.controller.js on lines 34..37

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

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

(function() {
  'use strict';

  function projectLogoBoxDirective() {
    return {
Severity: Minor
Found in app/scripts/projectlogo/projectlogo.directive.js and 1 other location - About 50 mins to fix
app/scripts/logos/logos.directive.js on lines 1..12

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

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

(function() {
  'use strict';

  function logoBoxDirective() {
    return {
Severity: Minor
Found in app/scripts/logos/logos.directive.js and 1 other location - About 50 mins to fix
app/scripts/projectlogo/projectlogo.directive.js on lines 1..12

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

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

            } else {
              Messagebus.publish('graphMinChange', this.datasets[0].min);
              Messagebus.publish('graphMaxChange', this.datasets[0].max);
            }
Severity: Minor
Found in app/scripts/ncwmsservice/ncwms.service.js and 1 other location - About 50 mins to fix
app/scripts/ncwmsservice/ncwms.service.js on lines 130..133

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

            if (this.datasets[0].graphicalMin !== 0) {
              Messagebus.publish('graphMinChange', this.datasets[0].graphicalMin);
              Messagebus.publish('graphMaxChange', this.datasets[0].graphicalMax);
            } else {
Severity: Minor
Found in app/scripts/ncwmsservice/ncwms.service.js and 1 other location - About 50 mins to fix
app/scripts/ncwmsservice/ncwms.service.js on lines 133..136

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

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

            this.addAxesAndLegend = function(svg, xAxis, yAxis, margin, chartWidth, chartHeight) {
Severity: Minor
Found in app/scripts/customgraph/customgraph.controller.js - About 45 mins to fix

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

      function OutlinesController($scope, $http, Cesium, CesiumViewerService, Messagebus, UserAgent) {
    Severity: Minor
    Found in app/scripts/outlines/outlines.controller.js - About 45 mins to fix

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

        function CesiumNcwmsLayerController($q, $http, Cesium, CesiumViewerService, NcwmsService, Messagebus) {
      Severity: Minor
      Found in app/scripts/cesiumncwmslayer/cesium.ncwms.layer.controller.js - About 45 mins to fix

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

                    this.drawPaths = function(svg, data, x, y, chartWidth, chartHeight) {
        Severity: Minor
        Found in app/scripts/customgraph/customgraph.controller.js - About 45 mins to fix

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

                    parameters.COLORSCALERANGE = this.logarithmic ? (1 + ',' + this.legendMax) : (this.legendMin + ',' + this.legendMax);
          Severity: Minor
          Found in app/scripts/cesiumncwmslayer/cesium.ncwms.layer.controller.js and 1 other location - About 40 mins to fix
          app/scripts/cesiumncwmslayer/cesium.ncwms.layer.controller.js on lines 129..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 49.

          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

                    parameters.COLORSCALERANGE = this.logarithmic ? (1 + ',' + this.legendMax) : (this.legendMin + ',' + this.legendMax);
          Severity: Minor
          Found in app/scripts/cesiumncwmslayer/cesium.ncwms.layer.controller.js and 1 other location - About 40 mins to fix
          app/scripts/cesiumncwmslayer/cesium.ncwms.layer.controller.js on lines 114..114

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

          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

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

            function CesiumViewerController($scope, $http, Cesium, CesiumViewerService, Messagebus) {
          Severity: Minor
          Found in app/scripts/cesiumviewer/cesium-viewer.controller.js - About 35 mins to fix

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

                this.getFeatureInfoSeries = function(selectedDataset, selectedPalette, boundingRect, callbackSuccess, callbackFailure) {
            Severity: Minor
            Found in app/scripts/ncwmsservice/ncwms.service.js - About 35 mins to fix

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

                  $scope.$watch('blc.legendMin', function(newValue, oldValue) {
                    if (newValue === oldValue) {
                      //Initialization, so we ignore this event.
                    } else {
                      Messagebus.publish('legendMinChange', newValue);
              Severity: Minor
              Found in app/scripts/biglegend/biglegend.controller.js and 1 other location - About 35 mins to fix
              app/scripts/biglegend/biglegend.controller.js on lines 39..45

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

              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

                      this.legendText[3] = Math.round10((Math.pow(10, 0.8 * logmin + 0.2 * logmax)), -2);
              Severity: Major
              Found in app/scripts/biglegend/biglegend.controller.js and 3 other locations - About 35 mins to fix
              app/scripts/biglegend/biglegend.controller.js on lines 71..71
              app/scripts/biglegend/biglegend.controller.js on lines 72..72
              app/scripts/biglegend/biglegend.controller.js on lines 73..73

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

              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

                      this.legendText[2] = Math.round10((Math.pow(10, 0.6 * logmin + 0.4 * logmax)), -2);
              Severity: Major
              Found in app/scripts/biglegend/biglegend.controller.js and 3 other locations - About 35 mins to fix
              app/scripts/biglegend/biglegend.controller.js on lines 70..70
              app/scripts/biglegend/biglegend.controller.js on lines 72..72
              app/scripts/biglegend/biglegend.controller.js on lines 73..73

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

              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

                      this.legendText[0] = Math.round10((Math.pow(10, 0.2 * logmin + 0.8 * logmax)), -2);
              Severity: Major
              Found in app/scripts/biglegend/biglegend.controller.js and 3 other locations - About 35 mins to fix
              app/scripts/biglegend/biglegend.controller.js on lines 70..70
              app/scripts/biglegend/biglegend.controller.js on lines 71..71
              app/scripts/biglegend/biglegend.controller.js on lines 72..72

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

              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

                      this.legendText[1] = Math.round10((Math.pow(10, 0.4 * logmin + 0.6 * logmax)), -2);
              Severity: Major
              Found in app/scripts/biglegend/biglegend.controller.js and 3 other locations - About 35 mins to fix
              app/scripts/biglegend/biglegend.controller.js on lines 70..70
              app/scripts/biglegend/biglegend.controller.js on lines 71..71
              app/scripts/biglegend/biglegend.controller.js on lines 73..73

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

              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