NLeSC/ahn-pointcloud-viewer

View on GitHub
app/scripts/pointcloud/pointcloud.service.js

Summary

Maintainability
F
1 wk
Test Coverage

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

    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

      Function HighQualityRenderer has 138 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var HighQualityRenderer = function() {
      
            var depthMaterial = null;
            var attributeMaterial = null;
            var normalizationMaterial = null;
      Severity: Major
      Found in app/scripts/pointcloud/pointcloud.service.js - About 5 hrs to fix

        Function EDLRenderer has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var EDLRenderer = function() {
        
              var edlMaterial = null;
              var attributeMaterial = null;
        
        
        Severity: Major
        Found in app/scripts/pointcloud/pointcloud.service.js - About 3 hrs to fix

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

                this.render = function(renderer) {
          
                  var width = me.elRenderArea.clientWidth;
                  var height = me.elRenderArea.clientHeight;
          
          
          Severity: Major
          Found in app/scripts/pointcloud/pointcloud.service.js - About 3 hrs to fix

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

                  this.render = function() {
                    initEDL();
            
                    resize();
            
            
            Severity: Major
            Found in app/scripts/pointcloud/pointcloud.service.js - About 2 hrs to fix

              Function PointcloudService has 17 arguments (exceeds 4 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 2 hrs to fix

                Function loadPointcloud has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    this.loadPointcloud = function() {
                      // load pointcloud
                      var pointcloudPath = DrivemapService.getPointcloudUrl();
                      me.stats.lasCoordinates.crs = DrivemapService.getCrs();
                
                
                Severity: Minor
                Found in app/scripts/pointcloud/pointcloud.service.js - About 1 hr to fix

                  Function initHQSPlats has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        var initHQSPlats = function() {
                          if (depthMaterial !== null) {
                            return;
                          }
                  
                  
                  Severity: Minor
                  Found in app/scripts/pointcloud/pointcloud.service.js - About 1 hr to fix

                    Function update has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        this.update = function() {
                          Potree.pointLoadLimit =  me.settings.pointCountTarget * 2 * 1000 * 1000;
                    
                          if (me.settings.useEDL) {
                            directionalLight.position.copy(camera.position);
                    Severity: Minor
                    Found in app/scripts/pointcloud/pointcloud.service.js - About 1 hr to fix

                      Function PotreeRenderer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var PotreeRenderer = function() {
                            var resize = function(width, height) {
                              var aspect = width / height;
                      
                              camera.aspect = aspect;
                      Severity: Minor
                      Found in app/scripts/pointcloud/pointcloud.service.js - About 1 hr to fix

                        Function getMousePointCloudIntersection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function getMousePointCloudIntersection() {
                              var vector = new THREE.Vector3(mouse.x, mouse.y, 0.5);
                              vector.unproject(camera);
                              var direction = vector.sub(camera.position).normalize();
                              var ray = new THREE.Ray(camera.position, direction);
                        Severity: Minor
                        Found in app/scripts/pointcloud/pointcloud.service.js - About 1 hr 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

                                '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

                          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

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

                                  rtNormalize = new THREE.WebGLRenderTarget(1024, 1024, {
                                    minFilter: THREE.LinearFilter,
                                    magFilter: THREE.NearestFilter,
                                    format: THREE.RGBAFormat,
                                    type: THREE.FloatType
                          Severity: Minor
                          Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 55 mins to fix
                          app/scripts/pointcloud/pointcloud.service.js on lines 604..609

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

                          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

                                  if (me.settings.showSkybox) {
                                    skybox.camera.rotation.copy(camera.rotation);
                                    me.renderer.render(skybox.scene, skybox.camera);
                                  // } else {
                                  //   me.renderer.render(sceneBG, cameraBG);
                          Severity: Minor
                          Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 55 mins to fix
                          app/scripts/pointcloud/pointcloud.service.js on lines 535..540

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

                          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

                                  rtDepth = new THREE.WebGLRenderTarget(1024, 1024, {
                                    minFilter: THREE.NearestFilter,
                                    magFilter: THREE.NearestFilter,
                                    format: THREE.RGBAFormat,
                                    type: THREE.FloatType
                          Severity: Minor
                          Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 55 mins to fix
                          app/scripts/pointcloud/pointcloud.service.js on lines 611..616

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

                          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

                                  if (me.settings.showSkybox) {
                                    skybox.camera.rotation.copy(camera.rotation);
                                    me.renderer.render(skybox.scene, skybox.camera);
                                  // } else {
                                  //   me.renderer.render(sceneBG, cameraBG);
                          Severity: Minor
                          Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 55 mins to fix
                          app/scripts/pointcloud/pointcloud.service.js on lines 851..856

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

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

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

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

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

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status