Showing 29 of 98 total issues
Function mapboxGlInteractiveDirectiveLink
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mapboxGlInteractiveDirectiveLink (scope, element, attrs, controller) {
if (!controller) {
throw new Error('Invalid angular-mapboxgl-directive controller');
}
Function mapboxGlFilterDirectiveLink
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mapboxGlFilterDirectiveLink (scope, element, attrs, controller) {
if (!controller) {
throw new Error('Invalid angular-mapboxgl-directive controller');
}
Consider simplifying this complex logical expression. Open
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);
}
Consider simplifying this complex logical expression. Open
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);
Avoid deeply nested control flow statements. Open
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 + '"');
}
Consider simplifying this complex logical expression. Open
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);
Consider simplifying this complex logical expression. Open
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);
}
Consider simplifying this complex logical expression. Open
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 {
Function addNewControlCreated
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var addNewControlCreated = function (controlName, newControl, isCustomControl, controlEvents, isEventsListenedByMap) {