Naimikan/angular-mapboxgl-directive

View on GitHub

Showing 29 of 98 total issues

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

    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

      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

          Avoid deeply nested control flow statements.
          Open

                                      if (feature.properties.hasOwnProperty(regexValue)) {
                                          popupMessage = popupMessage.replace(eachMatch, feature.properties[regexValue]);
                                      } else {
                                          throw new Error('Property "' + regexValue + '" isn\'t exist in source "' + feature.layer.source + '"');
                                      }
          Severity: Major
          Found in src/factories/popupsManager.js - About 45 mins to fix

            Consider simplifying this complex logical expression.
            Open

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

              Consider simplifying this complex logical expression.
              Open

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

                Consider simplifying this complex logical expression.
                Open

                            } else if (angular.isNumber(center.lat) && angular.isNumber(center.lng) && (center.lng > -180 || center.lng < 180) && (center.lat > -90 || center.lat < 90)) {
                                defer.resolve([center.lng, center.lat]);
                            } else if (angular.isArray(center) && center.length === 2 && angular.isNumber(center[0]) && angular.isNumber(center[1]) && (center[0] > -180 || center[0] < 180) && (center[1] > -90 || center[1] < 90)) {
                                defer.resolve(center);
                            } else {
                Severity: Major
                Found in src/factories/utils.js - About 40 mins to fix

                  Function addNewControlCreated has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        var addNewControlCreated = function (controlName, newControl, isCustomControl, controlEvents, isEventsListenedByMap) {
                  Severity: Minor
                  Found in src/directives/glControls.js - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language