NLeSC/ahn-pointcloud-viewer

View on GitHub

Showing 154 of 154 total issues

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

    this.startClipVolume = function() {
      this.resetState();
      this.clipVolumeActive = true;
      this.showTransformationToolboxTray = true;
      this.measuringService.startClipVolume();
Severity: Major
Found in app/scripts/measuring/measuring.controller.js and 1 other location - About 1 hr to fix
app/scripts/measuring/measuring.controller.js on lines 99..105

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

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

(function() {
  'use strict';

  function pattySearchPanel() {
    return {
Severity: Major
Found in app/scripts/searchbox/searchbox.directive.js and 7 other locations - About 1 hr to fix
app/scripts/biglegend/biglegend.directive.js on lines 1..14
app/scripts/earthcontrols/earthcontrols.directive.js on lines 1..15
app/scripts/extract/extraction.directive.js on lines 1..15
app/scripts/help/help.directive.js on lines 1..15
app/scripts/measuring/measuring.directive.js on lines 1..14
app/scripts/pointcloud/pointcloud-stats.directive.js on lines 1..15
app/scripts/settings/settings.directive.js on lines 1..15

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

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

(function() {
  'use strict';

  function pattySettings() {
    return {
Severity: Major
Found in app/scripts/settings/settings.directive.js and 7 other locations - About 1 hr to fix
app/scripts/biglegend/biglegend.directive.js on lines 1..14
app/scripts/earthcontrols/earthcontrols.directive.js on lines 1..15
app/scripts/extract/extraction.directive.js on lines 1..15
app/scripts/help/help.directive.js on lines 1..15
app/scripts/measuring/measuring.directive.js on lines 1..14
app/scripts/pointcloud/pointcloud-stats.directive.js on lines 1..15
app/scripts/searchbox/searchbox.directive.js on lines 1..15

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

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

    function onMouseMove(event){
    var I;
        var rect = scope.domElement.getBoundingClientRect();
        scope.mouse.x = ((event.clientX - rect.left) / scope.domElement.clientWidth) * 2 - 1;
        scope.mouse.y = -((event.clientY - rect.top) / scope.domElement.clientHeight) * 2 + 1;
Severity: Minor
Found in app/scripts/utils/MeasuringTool.js - About 1 hr to fix

    Function BingGeoCoderService has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function BingGeoCoderService($http) {
        /**
         * Bing maps API key
         * @type {String}
         */
    Severity: Minor
    Found in app/scripts/utils/binggeocoder.service.js - About 1 hr to fix

      Function DrivemapService has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function DrivemapService($http, $q, $log, proj4, pattyConf) {
          var me = this;
          this.data = {};
          var deferred = $q.defer();
      
      
      Severity: Minor
      Found in app/scripts/core/drivemap.service.js - About 1 hr to fix

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

              img.onload = function() {
                context.canvas.width = 5;
                context.canvas.height = 255;
        
                context.drawImage(img, 0, 0);
        Severity: Major
        Found in app/scripts/biglegend/biglegend.controller.js and 1 other location - About 1 hr to fix
        app/scripts/biglegend/biglegend.controller.js on lines 122..127

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

        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

              img.onload = function() {
                context.canvas.width = 1;
                context.canvas.height = 255;
        
                context.drawImage(img, 0, 0);
        Severity: Major
        Found in app/scripts/biglegend/biglegend.controller.js and 1 other location - About 1 hr to fix
        app/scripts/biglegend/biglegend.controller.js on lines 78..83

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

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

            this.update = function() {
              if (this.initialized) {
                this.tools.volume.update();
                this.tools.transformation.update();
                this.tools.heightprofile.update();
        Severity: Minor
        Found in app/scripts/measuring/measuring.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 drawSelection has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.drawSelection = function(bbox) {
                  // resize dragbox
                  var coordinates = [
                    [
                      [
            Severity: Minor
            Found in app/scripts/extract/minimap.extraction.selection.service.js - About 1 hr to fix

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

                  this.setupResizeControl = function() {
                    function ResizeControl(optOptions) {
                      var options = optOptions || {};
              
                      var button = document.createElement('button');
              Severity: Minor
              Found in app/scripts/minimap/minimap.controller.js - About 1 hr to fix

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

                      var lookatWaypoints = this.waypoints.map(function(coord) {
                        return SceneService.toLocal(new THREE.Vector3(coord[3], coord[4], coord[5]));
                      });
                Severity: Major
                Found in app/scripts/pointcloud/rail.service.js and 1 other location - About 1 hr to fix
                app/scripts/pointcloud/rail.service.js on lines 76..78

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

                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 cameraWaypoints = this.waypoints.map(function(coord) {
                        return SceneService.toLocal(new THREE.Vector3(coord[0], coord[1], coord[2]));
                      });
                Severity: Major
                Found in app/scripts/pointcloud/rail.service.js and 1 other location - About 1 hr to fix
                app/scripts/pointcloud/rail.service.js on lines 84..86

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

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

                    this.buildSelectionGeometry = function(leftTopLocal, rightTopLocal, rightBottomLocal, leftBottomLocal, color) {
                      var boxMaterial = new THREE.MeshBasicMaterial({
                        color: color,
                        side: THREE.DoubleSide,
                        transparent: true,
                Severity: Minor
                Found in app/scripts/extract/pointcloud.extraction.drawing.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

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

                    Potree.TextSprite.prototype.update = function(){
                    
                        var canvas = document.createElement('canvas');
                        var context = canvas.getContext('2d');
                        context.font = 'Bold ' + this.fontsize + 'px ' + this.fontface;
                    Severity: Minor
                    Found in app/scripts/utils/TextSprite.js - About 1 hr to fix

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

                            if (this._bottom > this._top) {
                              temp = this._top;
                              this._top = this._bottom;
                              this._bottom = temp;
                            }
                      Severity: Major
                      Found in app/scripts/extract/extraction.selection.service.js and 1 other location - About 1 hr to fix
                      app/scripts/extract/extraction.selection.service.js on lines 71..75

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

                      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._left > this._right) {
                              temp = this._right;
                              this._right = this._left;
                              this._left = temp;
                            }
                      Severity: Major
                      Found in app/scripts/extract/extraction.selection.service.js and 1 other location - About 1 hr to fix
                      app/scripts/extract/extraction.selection.service.js on lines 66..70

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

                      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

                                      edgeLabel.visible = this.showDistances && (index < lastIndex || this.closed) && this.points.length >= 2 && distance > 0;
                      Severity: Major
                      Found in app/scripts/utils/MeasuringTool.js and 1 other location - About 1 hr to fix
                      app/scripts/utils/MeasuringTool.js on lines 263..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 55.

                      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