Naimikan/angular-mapboxgl-directive

View on GitHub

Showing 98 of 98 total issues

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

    function mapboxGlVideoDirectiveLink (scope, element, attrs, controller) {
        if (!controller) {
            throw new Error('Invalid angular-mapboxgl-directive controller');
        }

Severity: Minor
Found in src/directives/glVideo.js - About 1 hr to fix

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

      AnimationsManager.prototype.initAnimationSystem = function () {
        var lastTime = 0;
        var vendors = ['ms', 'moz', 'webkit', 'o'];
    
        for (var iterator = 0; iterator < vendors.length && !window.requestAnimationFrame; ++iterator) {
    Severity: Minor
    Found in src/factories/animationsManager.js - About 1 hr to fix

      Function createMarkerByObject has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        MarkersManager.prototype.createMarkerByObject = function (object) {
          Utils.checkObjects([
            {
              name: 'Map',
              object: this.mapInstance
      Severity: Minor
      Found in src/factories/markersManager.js - About 1 hr to fix

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

            {
                name: 'navigation',
                constructor: mapboxgl.Navigation || mapboxgl.NavigationControl,
                pluginName: 'mapboxgl.' + (mapboxgl.Navigation ? mapboxgl.Navigation.name : mapboxgl.NavigationControl.name)
            }, {
        Severity: Major
        Found in src/constants/mapboxglConstants.js and 2 other locations - About 1 hr to fix
        src/constants/mapboxglConstants.js on lines 44..48
        src/constants/mapboxglConstants.js on lines 48..52

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

            }, {
                name: 'scale',
                constructor: mapboxgl.Scale || mapboxgl.ScaleControl,
                pluginName: 'mapboxgl.' + (mapboxgl.Scale ? mapboxgl.Scale.name : mapboxgl.ScaleControl.name)
            }, {
        Severity: Major
        Found in src/constants/mapboxglConstants.js and 2 other locations - About 1 hr to fix
        src/constants/mapboxglConstants.js on lines 40..44
        src/constants/mapboxglConstants.js on lines 48..52

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

          function mapboxGlMarkersDirectiveLink (scope, element, attrs, controller) {
            if (!controller) {
                    throw new Error('Invalid angular-mapboxgl-directive controller');
                }
        
        
        Severity: Minor
        Found in src/directives/glMarkers.js - About 1 hr to fix

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

              }, {
                  name: 'attribution',
                  constructor: mapboxgl.Attribution || mapboxgl.AttributionControl,
                  pluginName: 'mapboxgl.' + (mapboxgl.Attribution ? mapboxgl.Attribution.name : mapboxgl.AttributionControl.name)
              },/* {
          Severity: Major
          Found in src/constants/mapboxglConstants.js and 2 other locations - About 1 hr to fix
          src/constants/mapboxglConstants.js on lines 40..44
          src/constants/mapboxglConstants.js on lines 44..48

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

            function mapboxGlPopupDirectiveLink (scope, element, attrs, controller) {
              if (!controller) {
                      throw new Error('Invalid angular-mapboxgl-directive controller');
                  }
          
          
          Severity: Minor
          Found in src/directives/glPopups.js - About 1 hr to fix

            Function generatePopupMessage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              PopupsManager.prototype.generatePopupMessage = function (object, feature) {
                var popupMessage = angular.copy(object.message);
            
                if (popupMessage instanceof HTMLElement) {
                  return popupMessage;
            Severity: Minor
            Found in src/factories/popupsManager.js - About 1 hr to fix

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

                    if (scope.sourceManager.existSourceById(sourceObject.id)) {
                      scope.sourceManager.updateSourceByObject(sourceObject);
                    } else {
                      scope.sourceManager.createSourceByObject(sourceObject);
                    }
              Severity: Major
              Found in src/directives/glSources.js and 1 other location - About 1 hr to fix
              src/directives/glLayers.js on lines 102..106

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

              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 (scope.layersManager.existLayerById(layerObject.id)) {
                      scope.layersManager.updateLayerByObject(layerObject);
                    } else {
                      scope.layersManager.createLayerByObject(layerObject);
                    }
              Severity: Major
              Found in src/directives/glLayers.js and 1 other location - About 1 hr to fix
              src/directives/glSources.js on lines 10..14

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

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

                  function mapboxGlFilterDirectiveLink (scope, element, attrs, controller) {
                      if (!controller) {
                          throw new Error('Invalid angular-mapboxgl-directive controller');
                      }
              
              
              Severity: Minor
              Found in src/directives/glFilter.js - About 1 hr to fix

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

                  function mapboxGlInteractiveDirectiveLink (scope, element, attrs, controller) {
                    if (!controller) {
                            throw new Error('Invalid angular-mapboxgl-directive controller');
                        }
                
                
                Severity: Minor
                Found in src/directives/glInteractive.js - About 1 hr to fix

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

                          if (angular.isDefined(attrs.width)) {
                            updateWidth(map);
                  
                            scope.$watch(function () {
                              return element[0].getAttribute('width');
                  Severity: Major
                  Found in src/directives/mapboxgl.js and 1 other location - About 1 hr to fix
                  src/directives/mapboxgl.js on lines 218..230

                  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

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

                          if (angular.isDefined(attrs.height)) {
                            updateHeight(map);
                  
                            scope.$watch(function () {
                              return element[0].getAttribute('height');
                  Severity: Major
                  Found in src/directives/mapboxgl.js and 1 other location - About 1 hr to fix
                  src/directives/mapboxgl.js on lines 207..215

                  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

                  Consider simplifying this complex logical expression.
                  Open

                      } else if (angular.isDefined(sourceCreated._data) && angular.isDefined(sourceCreated._data.properties) && angular.isDefined(sourceCreated._data.properties.animation) && angular.isDefined(sourceCreated._data.properties.animation.enabled) && sourceCreated._data.properties.animation.enabled && angular.isDefined(sourceCreated._data.properties.animation.animationFunction) && angular.isFunction(sourceCreated._data.properties.animation.animationFunction)) {
                        self.createAnimationFunction(sourceObject.id, sourceCreated._data.properties.featureId, sourceCreated._data);
                      }
                  Severity: Major
                  Found in src/factories/sourcesManager.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        } else if (angular.isDefined(currentSource._data) && angular.isDefined(currentSource._data.properties) && angular.isDefined(currentSource._data.properties.animation) && angular.isDefined(currentSource._data.properties.animation.enabled) && currentSource._data.properties.animation.enabled && angular.isDefined(currentSource._data.properties.animation.animationFunction) && angular.isFunction(currentSource._data.properties.animation.animationFunction)) {
                          if (self.animationManager.existAnimationByFeatureId(currentSource._data.properties.featureId)) {
                            self.animationManager.updateAnimationFunction(currentSource._data.properties.featureId, currentSource._data.properties.animation.animationFunction, currentSource._data.properties.animation.animationData);
                          } else {
                            self.createAnimationFunction(sourceObject.id, currentSource._data.properties.featureId, currentSource._data);
                    Severity: Major
                    Found in src/factories/sourcesManager.js - About 1 hr to fix

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

                          if (angular.isDefined(sourceCreated._data) && angular.isDefined(sourceCreated._data.features) && angular.isArray(sourceCreated._data.features)) {
                      Severity: Minor
                      Found in src/factories/sourcesManager.js and 1 other location - About 55 mins to fix
                      src/factories/sourcesManager.js on lines 177..177

                      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

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

                          if (angular.isDefined(currentSource._data) && angular.isDefined(currentSource._data.features) && angular.isArray(currentSource._data.features) && currentSource._data.features.length > 0) {
                      Severity: Minor
                      Found in src/factories/sourcesManager.js and 1 other location - About 55 mins to fix
                      src/factories/sourcesManager.js on lines 106..106

                      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

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

                                    for (var iterator = 0, length = customControls.length; iterator < length; iterator++) {
                                      var eachCustomControl = customControls[iterator];
                      
                                      removeEventsFromControl(eachCustomControl.control, eachCustomControl.events, eachCustomControl.isEventsListenedByMap, map);
                      
                      
                      Severity: Minor
                      Found in src/directives/glControls.js and 1 other location - About 50 mins to fix
                      src/directives/glControls.js on lines 46..52

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

                      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