NLeSC/Cesium-NcWMS

View on GitHub

Showing 81 of 81 total issues

Function CustomGraphController has 374 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function CustomGraphController($scope, $window, $timeout, $http, d3Service, NcwmsService, Messagebus, UserAgent) {
    this.mobile = UserAgent.mobile;
    
    this.selectedLabel = '';
    this.selectedUnits = '';
Severity: Major
Found in app/scripts/customgraph/customgraph.controller.js - About 1 day to fix

    Function exports has 362 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
    
      // Load grunt tasks automatically
      require('load-grunt-tasks')(grunt);
    
    
    Severity: Major
    Found in Gruntfile.js - About 1 day to fix

      Function init has 299 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.init = function(element, attrs) {
            this.dragging = false;
      
            var container = element.children[0].children[1];
            var hoverContainer, hoverLine, hoverLineXOffset, hoverLineYOffset, hoverLineGroup,
      Severity: Major
      Found in app/scripts/customgraph/customgraph.controller.js - About 1 day to fix

        Function NcwmsService has 273 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function NcwmsService($q, $http, Messagebus) {
            this.ncWMSURL = 'http://localhost:8080/ncWMS-2.0-rc1-maartenvm/wms?';
        
            var deferred = $q.defer();
            this.ready = deferred.promise;
        Severity: Major
        Found in app/scripts/ncwmsservice/ncwms.service.js - About 1 day to fix

          Function render has 259 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  this.render = function(data) {
                    // remove all previous items before render
                    d3.select(container).selectAll('*').remove();
          
                    if (!this.activated) {
          Severity: Major
          Found in app/scripts/customgraph/customgraph.controller.js - About 1 day to fix

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

            (function() {
              'use strict';
            
              function TerrainController($scope, Messagebus, UserAgent) {
                this.mobile = UserAgent.mobile;
            Severity: Major
            Found in app/scripts/terrain/terrain.controller.js and 1 other location - About 6 hrs to fix
            app/scripts/logarithmic/logarithmic.controller.js on lines 1..30

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

            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 LogarithmicController($scope, Messagebus, UserAgent) {
                this.mobile = UserAgent.mobile;
            Severity: Major
            Found in app/scripts/logarithmic/logarithmic.controller.js and 1 other location - About 6 hrs to fix
            app/scripts/terrain/terrain.controller.js on lines 1..32

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

            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

            File customgraph.controller.js has 380 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function() {
              'use strict';
              /*
                source: D3 example @ http://bl.ocks.org/rkirsling/33a9e350516da54a5d4f
              */
            Severity: Minor
            Found in app/scripts/customgraph/customgraph.controller.js - About 5 hrs to fix

              Function CesiumNcwmsLayerController has 122 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function CesiumNcwmsLayerController($q, $http, Cesium, CesiumViewerService, NcwmsService, Messagebus) {
                  this.selectedTime = new Date(Date.UTC(1960, 0, 31, 0, 0, 0));
                  Messagebus.subscribe('ncwmsTimeSelected', function(event, value) {
                    if (this.selectedTime !== value) {
                      this.selectedTime = value;
              Severity: Major
              Found in app/scripts/cesiumncwmslayer/cesium.ncwms.layer.controller.js - About 4 hrs to fix

                File Gruntfile.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // Generated on 2015-02-10 using generator-angular 0.11.0
                'use strict';
                
                // # Globbing
                // for performance reasons we're only matching one level down:
                Severity: Minor
                Found in Gruntfile.js - About 4 hrs to fix

                  Function CesiumViewerController has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function CesiumViewerController($scope, $http, Cesium, CesiumViewerService, Messagebus) {
                      this.lastClicked = {
                        'latitude': '',
                        'longitude': '',
                        'meanValue': '',
                  Severity: Major
                  Found in app/scripts/cesiumviewer/cesium-viewer.controller.js - About 3 hrs to fix

                    Function getFeatureInfoSeries has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        this.getFeatureInfoSeries = function(selectedDataset, selectedPalette, boundingRect, callbackSuccess, callbackFailure) {
                          if (this.datasets.length === 0) {
                            return;
                          }
                    
                    
                    Severity: Major
                    Found in app/scripts/ncwmsservice/ncwms.service.js - About 3 hrs to fix

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

                                    var lowerOuterArea = d3.svg.area()
                                      .interpolate('basis')
                                      .x(function(d) {
                                        return x(d.date) || 1;
                                      })
                      Severity: Major
                      Found in app/scripts/customgraph/customgraph.controller.js and 3 other locations - About 3 hrs to fix
                      app/scripts/customgraph/customgraph.controller.js on lines 208..216
                      app/scripts/customgraph/customgraph.controller.js on lines 218..228
                      app/scripts/customgraph/customgraph.controller.js on lines 239..249

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                                    var upperOuterArea = d3.svg.area()
                                      .interpolate('basis')
                                      .x(function(d) {
                                        return x(d.date) || 1;
                                      }).y0(function(d) {
                      Severity: Major
                      Found in app/scripts/customgraph/customgraph.controller.js and 3 other locations - About 3 hrs to fix
                      app/scripts/customgraph/customgraph.controller.js on lines 218..228
                      app/scripts/customgraph/customgraph.controller.js on lines 239..249
                      app/scripts/customgraph/customgraph.controller.js on lines 251..261

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                                    var upperInnerArea = d3.svg.area()
                                      .interpolate('basis')
                                      .x(function(d) {
                                        return x(d.date) || 1;
                                      })
                      Severity: Major
                      Found in app/scripts/customgraph/customgraph.controller.js and 3 other locations - About 3 hrs to fix
                      app/scripts/customgraph/customgraph.controller.js on lines 208..216
                      app/scripts/customgraph/customgraph.controller.js on lines 239..249
                      app/scripts/customgraph/customgraph.controller.js on lines 251..261

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                                    var lowerInnerArea = d3.svg.area()
                                      .interpolate('basis')
                                      .x(function(d) {
                                        return x(d.date) || 1;
                                      })
                      Severity: Major
                      Found in app/scripts/customgraph/customgraph.controller.js and 3 other locations - About 3 hrs to fix
                      app/scripts/customgraph/customgraph.controller.js on lines 208..216
                      app/scripts/customgraph/customgraph.controller.js on lines 218..228
                      app/scripts/customgraph/customgraph.controller.js on lines 251..261

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

                      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 drawPaths has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  this.drawPaths = function(svg, data, x, y, chartWidth, chartHeight) {
                                    var pathContainer = svg.append('g');
                      
                                    var upperOuterArea = d3.svg.area()
                                      .interpolate('basis')
                      Severity: Major
                      Found in app/scripts/customgraph/customgraph.controller.js - About 3 hrs to fix

                        Function makeChart has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    this.makeChart = function(data) {
                                      var svgWidth = width;
                                      var svgHeight = width / 2;
                                      var margin = {
                                        top: 20,
                        Severity: Major
                        Found in app/scripts/customgraph/customgraph.controller.js - About 3 hrs to fix

                          Function init has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              this.init = function() {
                                // load JSON data
                                $http.get('serverconfig.json').then(function(res) {
                                  if (res.data.id === 'ncWMS') {
                                    this.ncWMSURL = res.data.url;
                          Severity: Major
                          Found in app/scripts/ncwmsservice/ncwms.service.js - About 3 hrs to fix

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

                                            img.onload = function() {
                                                ctx.canvas.width = 150;
                                                ctx.canvas.height = 10;
                            
                                                ctx.translate(150, 0);
                            Severity: Major
                            Found in app/scripts/palette/palette.iamlegend.directive.js and 1 other location - About 2 hrs to fix
                            app/scripts/palette/palette.controller.js on lines 27..34

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

                            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