dynamic/SilverStripe-Locator-Module

View on GitHub
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js

Summary

Maintainability
F
3 wks
Test Coverage

File jquery.storelocator.js has 1774 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! jQuery Google Maps Store Locator - v2.7.2 - 2016-12-03
* http://www.bjornblog.com/web/jquery-store-locator-plugin
* Copyright (c) 2016 Bjorn Holine; Licensed MIT */

;(function ($, window, document, undefined) {

Function processData has 247 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        processData: function (mappingObject, originPoint, data, page) {
            this.writeDebug('processData',arguments);
            var _this = this;
            var i = 0;
            var orig_lat, orig_lng, origin, name, maxDistance, marker, bounds, storeStart, storeNumToShow, myOptions, distError, openMap, infowindow;

Function taxonomyFiltering has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        taxonomyFiltering: function() {
            this.writeDebug('taxonomyFiltering');
            var _this = this;

            // Set up the filters

Function processForm has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        processForm: function (e) {
            this.writeDebug('processForm',arguments);
            var _this = this,
                distance = null,
                $addressInput = $('#' + this.settings.addressID),

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

        _getData: function (lat, lng, address, geocodeData ) {
            this.writeDebug('_getData',arguments);
            var _this = this,
                northEast = '',
                southWest = '',

Function createMarker has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        createMarker: function (point, name, address, letter, map, category) {
            this.writeDebug('createMarker',arguments);
            var marker, markerImg, letterMarkerImg;
            var categories = [];

Function _start has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _start: function () {
            this.writeDebug('_start');
            var _this = this,
                    doAutoGeo = this.settings.autoGeocode,
                    latlng,

Consider simplifying this complex logical expression.
Open

                if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || this.settings.catMarkers !== null || this.settings.markerImg !== null || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
                    marker = new google.maps.Marker({
                        position : point,
                        map      : map,
                        draggable: false,

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

        init: function () {
            var _this = this;
            this.writeDebug('init');
            // Calculate geocode distance functions
            if (this.settings.lengthUnit === 'km') {

Function _loadTemplates has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _loadTemplates: function () {
            this.writeDebug('_loadTemplates');
            var source;
            var _this = this;
            var templateError = '<div class="bh-sl-error">Error: Could not load plugin templates. Check the paths and ensure they have been uploaded. Paths will be wrong if you do not run this from a web server.</div>';

Function _defineLocationData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _defineLocationData: function (currentMarker, storeStart, page) {
            this.writeDebug('_defineLocationData',arguments);
            var indicator = '';
            this._createLocationVariables(currentMarker.get('id'));

Function mapping has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        mapping: function (mappingObject) {
            this.writeDebug('mapping',arguments);
            var _this = this;
            var orig_lat, orig_lng, geocodeData, origin, originPoint, page;
            if (!this.isEmptyObject(mappingObject)) {

Function defaultLocation has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        defaultLocation: function() {
            this.writeDebug('defaultLocation');
            var _this = this,
                distance = null,
                $distanceInput = $('#' + this.settings.maxDistanceID),

Function autoGeocodeQuery has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        autoGeocodeQuery: function (position) {
            this.writeDebug('autoGeocodeQuery',arguments);
            var _this = this,
                distance = null,
                $distanceInput = $('#' + this.settings.maxDistanceID),

Consider simplifying this complex logical expression.
Open

            if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
                indicator = markerId + 1;
            }
            else {
                if (page > 0) {

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

        createInfowindow: function (marker, location, infowindow, storeStart, page) {
            this.writeDebug('createInfowindow',arguments);
            var _this = this;
            // Define the location data
            var locations = this._defineLocationData(marker, storeStart, page);

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

        listClick: function(map, infowindow, storeStart, page) {
            this.writeDebug('listClick',arguments);
            var _this = this;

            $(document).on('click.' + pluginName, '.' + _this.settings.locationList + ' li', function () {

Function directionsRequest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        directionsRequest: function(origin, locID, map) {
            this.writeDebug('directionsRequest',arguments);

            // Directions request callback
            if (this.settings.callbackDirectionsRequest) {

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

        originMarker: function(map, origin, originPoint) {
            this.writeDebug('originMarker',arguments);

            if (this.settings.originMarker !== true) {
                return;

Consider simplifying this complex logical expression.
Open

            if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
                storeNum = locationset.length;
            }
            else {
                storeNum = _this.settings.storeLimit;

Avoid deeply nested control flow statements.
Open

                            if ($('#' + _this.settings.mapID).hasClass('bh-sl-map-open') === true) {
                                if ((olat) && (olng)) {
                                    _this.settings.mapSettings.zoom = 0;
                                    _this.processForm();
                                }

Avoid deeply nested control flow statements.
Open

                            if (!taxFilters[k]) {
                                taxFilters[k] = [];
                            }

Avoid deeply nested control flow statements.
Open

                                if ((olat) && (olng)) {
                                    _this.settings.mapSettings.zoom = 0;
                                    _this.processForm();
                                }
                                else {

Avoid deeply nested control flow statements.
Open

                                if ($('#' + _this.settings.mapID).hasClass('bh-sl-map-open') === true) {
                                    if ((olat) && (olng)) {
                                        if (_this.countFilters() === 0) {
                                            _this.settings.mapSettings.zoom = originalZoom;
                                        }

Function createMarker has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        createMarker: function (point, name, address, letter, map, category) {

Avoid deeply nested control flow statements.
Open

                            if(categories[i] in this.settings.catMarkers) {
                                markerImg = this.markerImage(this.settings.catMarkers[categories[i]][0], parseInt(this.settings.catMarkers[categories[i]][1]), parseInt(this.settings.catMarkers[categories[i]][2]));
                            }

Consider simplifying this complex logical expression.
Open

            if (
                ( _this.settings.fullMapStart === true && openMap === false ) ||
                ( _this.settings.autoGeocode === true && openMap === false ) ||
                ( _this.settings.defaultLoc === true && openMap === false )
            ) {

Consider simplifying this complex logical expression.
Open

                    if((this.settings.querystringParams === true && this.getQueryString(this.settings.addressID)) || (this.settings.querystringParams === true && this.getQueryString(this.settings.searchID)) || (this.settings.querystringParams === true && this.getQueryString(this.settings.maxDistanceID))) {
                        _this.writeDebug('Using Query String');
                        this.processForm(null);
                        doAutoGeo = false; // No need for additional processing
                    }

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

        createInfowindow: function (marker, location, infowindow, storeStart, page) {

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

        locationsSetup: function (data, lat, lng, origin, maxDistance) {

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

        geoCodeCalcCalcDistance: function (lat1, lng1, lat2, lng2, radius) {

Avoid too many return statements within this function.
Open

                return d.promise();

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

            if(this.settings.querystringParams === true) {
                // Check for distance query string parameters
                if(this.getQueryString(this.settings.maxDistanceID)){
                    distance = this.getQueryString(this.settings.maxDistanceID);

thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1325..1346

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

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

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

            if(this.settings.querystringParams === true) {
                // Check for distance query string parameters
                if(this.getQueryString(this.settings.maxDistanceID)){
                    distance = this.getQueryString(this.settings.maxDistanceID);

thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1263..1284

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

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 (this.settings.dataType === 'kml' && this.settings.listTemplateID === null && this.settings.infowindowTemplateID === null) {

                // Try loading the external template files
                $.when(
                    // KML infowindows
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 438..461

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

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

            else {
                // Try loading the external template files
                $.when(
                    // Infowindows
                    $.get(this.settings.infowindowTemplatePath, function (template) {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 401..425

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

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

            r.geocode({'latLng': latlng}, function (data) {
                if (data !== null) {
                    originAddress = addressInput = data.address;
                    olat = mappingObj.lat = position.coords.latitude;
                    olng = mappingObj.lng = position.coords.longitude;
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1351..1363

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

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

            r.geocode({'latLng': latlng}, function (data) {
                if (data !== null) {
                    originAddress = addressInput = data.address;
                    olat = mappingObj.lat = _this.settings.defaultLat;
                    olng = mappingObj.lng = _this.settings.defaultLng;
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1289..1301

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

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(this.settings.markerImg !== null) {
                if(this.settings.markerDim === null) {
                    markerImg = this.markerImage(this.settings.markerImg);
                }
                else {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2032..2044

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

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(this.settings.originMarkerImg !== null) {
                    if(this.settings.originMarkerDim === null) {
                        originImg = this.markerImage(this.settings.originMarkerImg);
                    }
                    else {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1048..1055

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

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 ($('#' + _this.settings.mapID).hasClass('bh-sl-map-open') === true) {
                                if ((olat) && (olng)) {
                                    _this.settings.mapSettings.zoom = 0;
                                    _this.processForm();
                                }
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1883..1891

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

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 ($('#' + _this.settings.mapID).hasClass('bh-sl-map-open') === true) {
                                if ((olat) && (olng)) {
                                    _this.settings.mapSettings.zoom = 0;
                                    _this.processForm();
                                }
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1837..1845

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

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

            google.maps.event.addDomListener(window, 'resize', function() {
                var center = _this.map.getCenter();
                google.maps.event.trigger(_this.map, 'resize');
                _this.map.setCenter(center);
            });
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 618..622

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

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

                google.maps.event.addDomListener(window, 'resize', function() {
                    var center = _this.map.getCenter();
                    google.maps.event.trigger(_this.map, 'resize');
                    _this.map.setCenter(center);
                });
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2530..2534

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

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

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

            if(this.settings.querystringParams === true) {
                // Check for query string parameters
                if(this.getQueryString(this.settings.addressID) || this.getQueryString(this.settings.searchID) || this.getQueryString(this.settings.maxDistanceID)){
                    addressInput = this.getQueryString(this.settings.addressID);
                    searchInput = this.getQueryString(this.settings.searchID);
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1524..1548

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

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

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

                if(this.getQueryString(this.settings.addressID) || this.getQueryString(this.settings.searchID) || this.getQueryString(this.settings.maxDistanceID)){
                    addressInput = this.getQueryString(this.settings.addressID);
                    searchInput = this.getQueryString(this.settings.searchID);
                    distance = this.getQueryString(this.settings.maxDistanceID);

thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1522..1558

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

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

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

                if ($(this).prop('checked')) {
                    var filterVal = $(this).val();

                    // Only add the taxonomy id if it doesn't already exist
                    if (typeof filterVal !== 'undefined' && filterVal !== '' && filters[key].indexOf(filterVal) === -1) {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1702..1709

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

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

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

            $('#' + this.settings.taxonomyFilters[key] + ' select').each(function () {
                var filterVal = $(this).val();

                // Only add the taxonomy id if it doesn't already exist
                if (typeof filterVal !== 'undefined' && filterVal !== '' &&  filters[key].indexOf(filterVal) === -1) {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1720..1727

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

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 (page > 0) {
                    indicator = String.fromCharCode('A'.charCodeAt(0) + (storeStart + markerId));
                }
                else {
                    indicator = String.fromCharCode('A'.charCodeAt(0) + markerId);
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2580..2585

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

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 (page > 0) {
                    letter = String.fromCharCode('A'.charCodeAt(0) + (storeStart + y));
                }
                else {
                    letter = String.fromCharCode('A'.charCodeAt(0) + y);
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1129..1134

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

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

            if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1064..1064
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2476..2476

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

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

            if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1064..1064
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1125..1125

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

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

                if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || this.settings.catMarkers !== null || this.settings.markerImg !== null || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1125..1125
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2476..2476

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

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

                if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
                    bounds.extend(point);
                }
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2504..2524
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2599..2601

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

            if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
                _this.map.fitBounds(bounds);
            }
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2504..2524
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2591..2593

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

            if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
                myOptions = _this.settings.mapSettings;
                bounds = new google.maps.LatLngBounds();
            }
            else if (_this.settings.pagination === true) {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2591..2593
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2599..2601

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

            if (!this.isEmptyObject(mappingObject)) {
                orig_lat = mappingObject.lat;
                orig_lng = mappingObject.lng;
                geocodeData = mappingObject.geocodeResult;
                origin = mappingObject.origin;
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2293..2299

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

            if (!this.isEmptyObject(mappingObject)) {
                orig_lat = mappingObject.lat;
                orig_lng = mappingObject.lng;
                origin = mappingObject.origin;
                name = mappingObject.name;
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 2226..2232

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

            if (locationData.distance <= 1) {
                if (this.settings.lengthUnit === 'km') {
                    distLength = this.settings.kilometerLang;
                }
                else {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1113..1120

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

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

            else {
                if (this.settings.lengthUnit === 'km') {
                    distLength = this.settings.kilometersLang;
                }
                else {
thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js on lines 1105..1112

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

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

There are no issues that match your filters.

Category
Status