NLeSC/PattyVis

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

Summary

Maintainability
F
6 days
Test Coverage

Function PointcloudService has 390 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function PointcloudService(THREE, Potree, $window, $rootScope,
    DrivemapService,
    SitesService, CameraService, SceneService,
    PathControls, SiteBoxService, MeasuringService, Messagebus) {

Severity: Major
Found in app/scripts/pointcloud/pointcloud.service.js - About 1 day to fix

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

    /* global requestAnimationFrame:false */
    (function() {
      'use strict';
    
      function PointcloudService(THREE, Potree, $window, $rootScope,
    Severity: Minor
    Found in app/scripts/pointcloud/pointcloud.service.js - About 5 hrs to fix

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

          this.update = function() {
            if (pointcloud) {
              pointcloud.material.clipMode = me.settings.clipMode;
              pointcloud.material.size = me.settings.pointSize;
              pointcloud.visiblePointsTarget = me.settings.pointCountTarget * 1000 * 1000;
      Severity: Minor
      Found in app/scripts/pointcloud/pointcloud.service.js - About 1 hr to fix

        Function PointcloudService has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          function PointcloudService(THREE, Potree, $window, $rootScope,
            DrivemapService,
            SitesService, CameraService, SceneService,
            PathControls, SiteBoxService, MeasuringService, Messagebus) {
        Severity: Major
        Found in app/scripts/pointcloud/pointcloud.service.js - About 1 hr to fix

          Function loadPointcloud has 34 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 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 2 locations. Consider refactoring.
              Open

                    if (sitePointcloud) {
                      sitePointcloud.material.clipMode = me.siteSettings.clipMode;
                      sitePointcloud.material.size = me.siteSettings.pointSize;
                      sitePointcloud.visiblePointsTarget = me.siteSettings.pointCountTarget * 1000 * 1000;
                      sitePointcloud.material.opacity = me.siteSettings.opacity;
              Severity: Major
              Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 1 day to fix
              app/scripts/pointcloud/pointcloud.service.js on lines 489..505

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

              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 (pointcloud) {
                      pointcloud.material.clipMode = me.settings.clipMode;
                      pointcloud.material.size = me.settings.pointSize;
                      pointcloud.visiblePointsTarget = me.settings.pointCountTarget * 1000 * 1000;
                      pointcloud.material.opacity = me.settings.opacity;
              Severity: Major
              Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 1 day to fix
              app/scripts/pointcloud/pointcloud.service.js on lines 507..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 271.

              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

                      var lookPath = DrivemapService.getLookPath().map(
                        function(coord) {
                          return SceneService.toLocal(new THREE.Vector3(coord[0], coord[1], coord[2]));
                        }
                      );
              Severity: Major
              Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 1 hr to fix
              app/scripts/pointcloud/pointcloud.service.js on lines 247..251

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

              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

                      var cameraPath = DrivemapService.getCameraPath().map(
                        function(coord) {
                          return SceneService.toLocal(new THREE.Vector3(coord[0], coord[1], coord[2]));
                        }
                      );
              Severity: Major
              Found in app/scripts/pointcloud/pointcloud.service.js and 1 other location - About 1 hr to fix
              app/scripts/pointcloud/pointcloud.service.js on lines 253..257

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

              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