NLeSC/PattyVis

View on GitHub

Showing 91 of 91 total issues

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

    this.toggleRotate = function() {
      this.measuringService.activeTransformationTool = this.measuringService.transformationTools.ROTATE;
      this.resetState();
      this.showTransformationToolboxTray = true;
      this.measuringService.tools.transformation.rotate();
Severity: Major
Found in app/scripts/measuring/measuring.controller.js and 2 other locations - About 2 hrs to fix
app/scripts/measuring/measuring.controller.js on lines 137..142
app/scripts/measuring/measuring.controller.js on lines 144..149

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

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.toggleScale = function() {
      this.measuringService.activeTransformationTool = this.measuringService.transformationTools.SCALE;
      this.resetState();
      this.showTransformationToolboxTray = true;
      this.measuringService.tools.transformation.scale();
Severity: Major
Found in app/scripts/measuring/measuring.controller.js and 2 other locations - About 2 hrs to fix
app/scripts/measuring/measuring.controller.js on lines 130..135
app/scripts/measuring/measuring.controller.js on lines 137..142

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

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.toggleTranslate = function() {
      this.measuringService.activeTransformationTool = this.measuringService.transformationTools.TRANSLATE;
      this.resetState();
      this.showTransformationToolboxTray = true;
      this.measuringService.tools.transformation.translate();
Severity: Major
Found in app/scripts/measuring/measuring.controller.js and 2 other locations - About 2 hrs to fix
app/scripts/measuring/measuring.controller.js on lines 130..135
app/scripts/measuring/measuring.controller.js on lines 144..149

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

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

  function NexusService(Presenter, SphereTrackball) {
    var service = {};
    service.siteShown = false;
    service.setTarget = function(element) {
      this.presenter = new Presenter(element);
Severity: Major
Found in app/scripts/nexus/nexus.service.js - About 2 hrs to fix

    Function searched has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              this.filtered = this.searched = this.all.filter(function(site) {
                var descriptionSite = site.description_site; // jshint ignore:line
                var siteInterpretation = site.site_interpretation; // jshint ignore:line
                var siteContext = site.site_context; // jshint ignore:line
                var allText = descriptionSite +
    Severity: Major
    Found in app/scripts/core/sites.service.js - About 2 hrs to fix

      Function CameraService has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function CameraService($window, $log, THREE, Messagebus, SceneService) {
          var me = this;
          var fov = 75;
          var width = $window.innerWidth;
          var height = $window.innerHeight;
      Severity: Major
      Found in app/scripts/pointcloud/camera.service.js - About 2 hrs to fix

        Function createSiteBox has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.createSiteBox = function(site) {
              var bBox;
        
              var siteCenter = SitesService.centerOfSite(site);
              //var boxSize = SitesService.getBoundingBoxSize(site);
        Severity: Major
        Found in app/scripts/pointcloud/site-box.service.js - About 2 hrs to fix

          Function addTextLabel has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.addTextLabel = function(siteBox) {
                // parameters
                var canvasSize = 1000; // pt != on-screen pixels
                var fontsize = 40; // pt (same as canvas size)
                var textBoxPadding = fontsize / 2; // pt
          Severity: Minor
          Found in app/scripts/pointcloud/site-box.service.js - About 1 hr to fix

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

                    var lookTubeMesh = THREE.SceneUtils.createMultiMaterialObject( lookTube, [
                            new THREE.MeshLambertMaterial({
                                color: 0x0000ff
                            }),
                            new THREE.MeshBasicMaterial({
            Severity: Major
            Found in app/scripts/pointcloud/path.controls.js and 1 other location - About 1 hr to fix
            app/scripts/pointcloud/path.controls.js on lines 227..236

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

            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 tubeMesh = THREE.SceneUtils.createMultiMaterialObject( tube, [
                            new THREE.MeshLambertMaterial({
                                color: 0x00ffff
                            }),
                            new THREE.MeshBasicMaterial({
            Severity: Major
            Found in app/scripts/pointcloud/path.controls.js and 1 other location - About 1 hr to fix
            app/scripts/pointcloud/path.controls.js on lines 237..246

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

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

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

                    this.isTransformationTranslate = function() {
                      var result = false;
                      if (this.measuringService.activeTransformationTool === this.measuringService.transformationTools.TRANSLATE) {
                        result = true;
                      }
                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 36..42
                app/scripts/measuring/measuring.controller.js on lines 52..58

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

                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.isTransformationRotate = function() {
                      var result = false;
                      if (this.measuringService.activeTransformationTool === this.measuringService.transformationTools.ROTATE) {
                        result = true;
                      }
                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 44..50
                app/scripts/measuring/measuring.controller.js on lines 52..58

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

                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.isTransformationScale = function() {
                      var result = false;
                      if (this.measuringService.activeTransformationTool === this.measuringService.transformationTools.SCALE) {
                        result = true;
                      }
                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 36..42
                app/scripts/measuring/measuring.controller.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 64.

                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

                      document.addEventListener('keyup', e => {
                        if (keys.indexOf(e.key) !== -1) {
                          this[direction] = false;
                          $rootScope.$applyAsync();
                        }
                Severity: Major
                Found in app/scripts/keyboard/keyboard.controller.js and 1 other location - About 1 hr to fix
                app/scripts/keyboard/keyboard.controller.js on lines 25..30

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

                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

                      document.addEventListener('keydown', e => {
                        if (keys.indexOf(e.key) !== -1) {
                          this[direction] = true;
                          $rootScope.$applyAsync();
                        }
                Severity: Major
                Found in app/scripts/keyboard/keyboard.controller.js and 1 other location - About 1 hr to fix
                app/scripts/keyboard/keyboard.controller.js on lines 31..36

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

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

                  function CamFrustumService(ol, proj4, DrivemapService) {
                    var olProjectionCode = 'EPSG:3857';
                    var siteProjectionCode = null;
                
                    DrivemapService.ready.then(function() {
                Severity: Minor
                Found in app/scripts/minimap/cam-frustum.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

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

                        this.startHeightProfile = function() {
                          this.resetState();
                          this.heightProfileActive = true;
                          this.showTransformationToolboxTray = true;
                          this.measuringService.startHeightProfile();
                    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 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

                    Severity
                    Category
                    Status
                    Source
                    Language