NLeSC/PattyVis

View on GitHub

Showing 91 of 91 total issues

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

(function() {
  'use strict';

  function pattyPointcloudStats() {
    return {
Severity: Major
Found in app/scripts/pointcloud/pointcloud-stats.directive.js and 6 other locations - About 1 hr to fix
app/scripts/cameramodes/cameramodes.directive.js on lines 1..15
app/scripts/help/help.directive.js on lines 1..15
app/scripts/keyboard/keyboard.directive.js on lines 1..15
app/scripts/measuring/measuring.directive.js on lines 1..14
app/scripts/searchbox/searchbox.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 3 locations. Consider refactoring.
Open

    this.startVolume = function() {
      this.resetState();
      this.volumeActive = true;
      this.showTransformationToolboxTray = true;
      this.measuringService.startVolume();
Severity: Major
Found in app/scripts/measuring/measuring.controller.js and 2 other locations - About 1 hr to fix
app/scripts/measuring/measuring.controller.js on lines 116..121
app/scripts/measuring/measuring.controller.js on lines 123..128

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

(function() {
  'use strict';

  function pattyCameraModes() {
    return {
Severity: Major
Found in app/scripts/cameramodes/cameramodes.directive.js and 6 other locations - About 1 hr to fix
app/scripts/help/help.directive.js on lines 1..15
app/scripts/keyboard/keyboard.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
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 7 locations. Consider refactoring.
Open

(function() {
  'use strict';

  function pattySettings() {
    return {
Severity: Major
Found in app/scripts/settings/settings.directive.js and 6 other locations - About 1 hr to fix
app/scripts/cameramodes/cameramodes.directive.js on lines 1..15
app/scripts/help/help.directive.js on lines 1..15
app/scripts/keyboard/keyboard.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

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

(function() {
  'use strict';

  function measuringDirective() {
    return {
Severity: Major
Found in app/scripts/measuring/measuring.directive.js and 6 other locations - About 1 hr to fix
app/scripts/cameramodes/cameramodes.directive.js on lines 1..15
app/scripts/help/help.directive.js on lines 1..15
app/scripts/keyboard/keyboard.directive.js on lines 1..15
app/scripts/pointcloud/pointcloud-stats.directive.js on lines 1..15
app/scripts/searchbox/searchbox.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 7 locations. Consider refactoring.
Open

(function() {
  'use strict';

  function pattyKeyboard() {
    return {
Severity: Major
Found in app/scripts/keyboard/keyboard.directive.js and 6 other locations - About 1 hr to fix
app/scripts/cameramodes/cameramodes.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
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 7 locations. Consider refactoring.
Open

(function() {
  'use strict';

  function pattyHelp() {
    return {
Severity: Major
Found in app/scripts/help/help.directive.js and 6 other locations - About 1 hr to fix
app/scripts/cameramodes/cameramodes.directive.js on lines 1..15
app/scripts/keyboard/keyboard.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
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 7 locations. Consider refactoring.
Open

(function() {
  'use strict';

  function pattySearchPanel() {
    return {
Severity: Major
Found in app/scripts/searchbox/searchbox.directive.js and 6 other locations - About 1 hr to fix
app/scripts/cameramodes/cameramodes.directive.js on lines 1..15
app/scripts/help/help.directive.js on lines 1..15
app/scripts/keyboard/keyboard.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 3 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 2 other locations - About 1 hr to fix
app/scripts/measuring/measuring.controller.js on lines 108..114
app/scripts/measuring/measuring.controller.js on lines 116..121

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

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

    Function setupResizeControl has 30 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

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

            function KeyboardController($rootScope, PathControls, PointcloudService, CameraService) {
              this.up = false;
              this.left = false;
              this.down = false;
              this.right = false;
          Severity: Minor
          Found in app/scripts/keyboard/keyboard.controller.js - About 1 hr to fix

            Function getBoundingBoxOfFootprint has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  getBoundingBoxOfFootprint: function(site) {
                    var minlon = Number.POSITIVE_INFINITY;
                    var minlat = Number.POSITIVE_INFINITY;
                    var minalt = site.footprint_altitude[0]; // jshint ignore:line
                    var maxlon = Number.NEGATIVE_INFINITY;
            Severity: Minor
            Found in app/scripts/core/sites.service.js - About 1 hr to fix

              Function createPath has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  PathControls.prototype.createPath = function() {
                      var tube = new THREE.TubeGeometry(path, 1024, 0.25, 8, false);
                      var lookTube = new THREE.TubeGeometry(lookatPath, 1024, 0.25, 8, false);
              
                      var tubeMesh = THREE.SceneUtils.createMultiMaterialObject( tube, [
              Severity: Minor
              Found in app/scripts/pointcloud/path.controls.js - About 1 hr to fix

                Function ResizeControl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      function ResizeControl(optOptions) {
                        var options = optOptions || {};
                
                        var button = document.createElement('button');
                        button.innerHTML = '<span class="glyphicon glyphicon-resize-full"></span>';
                Severity: Minor
                Found in app/scripts/minimap/minimap.controller.js - About 1 hr to fix

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

                        if (event.keyCode === 69) {
                          // e pressed
                          this.activeTransformationTool = this.transformationTools.SCALE;
                          $rootScope.$digest();
                  
                  
                  Severity: Major
                  Found in app/scripts/measuring/measuring.service.js and 2 other locations - About 55 mins to fix
                  app/scripts/measuring/measuring.service.js on lines 38..50
                  app/scripts/measuring/measuring.service.js on lines 44..50

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

                  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