NLeSC/ahn-pointcloud-viewer

View on GitHub

Showing 154 of 154 total issues

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

    Potree.Gradients.VIRIDIS = [
      [0, new THREE.Color(0.267, 0.0049, 0.3294)],
      [0.0039, new THREE.Color(0.2685, 0.0096, 0.3354)],
      [0.0078, new THREE.Color(0.2699, 0.0146, 0.3414)],
      [0.0118, new THREE.Color(0.2713, 0.0199, 0.3473)],
Severity: Major
Found in app/scripts/pointcloud/gradients.service.js and 1 other location - About 3 wks to fix
app/scripts/pointcloud/gradients.service.js on lines 265..522

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

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

    Potree.Gradients.REALISTIC = [
      [0, new THREE.Color(1.0000, 1.0000, 0.9804)],
      [0.0039, new THREE.Color(0.9686, 0.9686, 0.9804)],
      [0.0078, new THREE.Color(0.9373, 0.9373, 0.9804)],
      [0.0118, new THREE.Color(0.9059, 0.9059, 0.9804)],
Severity: Major
Found in app/scripts/pointcloud/gradients.service.js and 1 other location - About 3 wks to fix
app/scripts/pointcloud/gradients.service.js on lines 6..263

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

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

  function PointcloudService(THREE, Potree, $window, $rootScope, $location,
    DrivemapService,
    CameraService, SceneService,
    PathControls, MeasuringService, EarthcontrolsService,
    RailService, ExtractionDrawingService, PointcloudExtractionSelectionService,
Severity: Major
Found in app/scripts/pointcloud/pointcloud.service.js - About 3 days to fix

    Function GradientsService has 516 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function GradientsService() {
        Potree.Gradients.VIRIDIS = [
          [0, new THREE.Color(0.267, 0.0049, 0.3294)],
          [0.0039, new THREE.Color(0.2685, 0.0096, 0.3354)],
          [0.0078, new THREE.Color(0.2699, 0.0146, 0.3414)],
    Severity: Major
    Found in app/scripts/pointcloud/gradients.service.js - About 2 days to fix

      Function MeasuringTool has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
      Open

      Potree.MeasuringTool = function(scene, camera, renderer){
      
          var scope = this;
          this.enabled = false;
      
      
      Severity: Minor
      Found in app/scripts/utils/MeasuringTool.js - About 2 days to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function exports has 423 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 2 days to fix

        Function MeasuringTool has 313 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Potree.MeasuringTool = function(scene, camera, renderer){
        
            var scope = this;
            this.enabled = false;
        
        
        Severity: Major
        Found in app/scripts/utils/MeasuringTool.js - About 1 day to fix

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

          /* global requestAnimationFrame:false  */
          
          (function() {
            'use strict';
          
          
          Severity: Major
          Found in app/scripts/pointcloud/pointcloud.service.js - About 1 day to fix

            File MeasuringTool.js has 558 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            
            'use strict';
            /* global THREE:false, Potree:false  */
            
            Potree.Measure = function(){
            Severity: Major
            Found in app/scripts/utils/MeasuringTool.js - About 1 day to fix

              File gradients.service.js has 522 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              (function () {
                'use strict';
                /* global THREE:false, Potree:false  */
              
                function GradientsService() {
              Severity: Major
              Found in app/scripts/pointcloud/gradients.service.js - About 1 day to fix

                Function Measure has 211 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Potree.Measure = function(){
                    var scope = this;
                
                    THREE.Object3D.call( this );
                
                
                Severity: Major
                Found in app/scripts/utils/MeasuringTool.js - About 1 day to fix

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

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

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

                        'HIGH': {
                          pointCountTarget: 5,
                          pointSize: 1.00,
                          opacity: 1,
                          showSkybox: true,
                    Severity: Major
                    Found in app/scripts/pointcloud/pointcloud.service.js and 3 other locations - About 6 hrs to fix
                    app/scripts/pointcloud/pointcloud.service.js on lines 46..69
                    app/scripts/pointcloud/pointcloud.service.js on lines 70..93
                    app/scripts/pointcloud/pointcloud.service.js on lines 118..141

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

                    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

                        'ULTRA': {
                          pointCountTarget: 10,
                          pointSize: 0.5,
                          opacity: 1,
                          showSkybox: true,
                    Severity: Major
                    Found in app/scripts/pointcloud/pointcloud.service.js and 3 other locations - About 6 hrs to fix
                    app/scripts/pointcloud/pointcloud.service.js on lines 46..69
                    app/scripts/pointcloud/pointcloud.service.js on lines 70..93
                    app/scripts/pointcloud/pointcloud.service.js on lines 94..117

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

                    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

                          'LOW': {
                          pointCountTarget: 2.5,
                          pointSize: 2.00,
                          opacity: 1,
                          showSkybox: false,
                    Severity: Major
                    Found in app/scripts/pointcloud/pointcloud.service.js and 3 other locations - About 6 hrs to fix
                    app/scripts/pointcloud/pointcloud.service.js on lines 70..93
                    app/scripts/pointcloud/pointcloud.service.js on lines 94..117
                    app/scripts/pointcloud/pointcloud.service.js on lines 118..141

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

                    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

                          'STANDARD': {
                          pointCountTarget: 5.0,
                          pointSize: 1.00,
                          opacity: 1,
                          showSkybox: true,
                    Severity: Major
                    Found in app/scripts/pointcloud/pointcloud.service.js and 3 other locations - About 6 hrs to fix
                    app/scripts/pointcloud/pointcloud.service.js on lines 46..69
                    app/scripts/pointcloud/pointcloud.service.js on lines 94..117
                    app/scripts/pointcloud/pointcloud.service.js on lines 118..141

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

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

                      function MeasuringService($rootScope, Potree, THREE, $window) {
                        this.tools = {
                          measuring: null,
                          volume: null,
                          heightprofile: null,
                    Severity: Major
                    Found in app/scripts/measuring/measuring.service.js - About 5 hrs to fix

                      Function RailService has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function RailService(CameraService, SceneService, THREE, toastr, $window) {
                          /**
                           * A waypoint is a user picked camera location and look at location.
                           * Format of one waypoint is [camX,camY,camZ,lookatX,lookatY, lookatZ]
                           * Positions are in geospatial coordinate system.
                      Severity: Major
                      Found in app/scripts/pointcloud/rail.service.js - About 5 hrs to fix

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

                                    for(j = 0; j < measurement.edgeLabels.length; j++){
                                        label = measurement.angleLabels[j];
                        
                                        distance = scope.camera.position.distanceTo(label.getWorldPosition());
                                        pr = projectedRadius(1, scope.camera.fov * Math.PI / 180, distance, renderer.domElement.clientHeight);
                        Severity: Major
                        Found in app/scripts/utils/MeasuringTool.js and 1 other location - About 5 hrs to fix
                        app/scripts/utils/MeasuringTool.js on lines 695..703

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

                        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

                                    for(j = 0; j < measurement.edgeLabels.length; j++){
                                        label = measurement.edgeLabels[j];
                        
                                        distance = scope.camera.position.distanceTo(label.getWorldPosition());
                                        pr = projectedRadius(1, scope.camera.fov * Math.PI / 180, distance, renderer.domElement.clientHeight);
                        Severity: Major
                        Found in app/scripts/utils/MeasuringTool.js and 1 other location - About 5 hrs to fix
                        app/scripts/utils/MeasuringTool.js on lines 706..714

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

                        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