Showing 42 of 74 total issues
File jquery.storelocator.js
has 1774 lines of code (exceeds 250 allowed). Consider refactoring. Open
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) {
- Create a ticketCreate a ticket
Function processData
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
- Create a ticketCreate a ticket
Function processForm
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
processForm: function (e) {
this.writeDebug('processForm',arguments);
var _this = this,
distance = null,
$addressInput = $('#' + this.settings.addressID),
- Create a ticketCreate a ticket
Function taxonomyFiltering
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
taxonomyFiltering: function() {
this.writeDebug('taxonomyFiltering');
var _this = this;
// Set up the filters
- Create a ticketCreate a ticket
Method init
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function init()
{
parent::init();
// prevent init of map if no query
- Create a ticketCreate a ticket
Function _getData
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getData: function (lat, lng, address, geocodeData ) {
this.writeDebug('_getData',arguments);
var _this = this,
northEast = '',
southWest = '',
- Create a ticketCreate a ticket
Function createMarker
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createMarker: function (point, name, address, letter, map, category) {
this.writeDebug('createMarker',arguments);
var marker, markerImg, letterMarkerImg;
var categories = [];
- Create a ticketCreate a ticket
Function _start
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_start: function () {
this.writeDebug('_start');
var _this = this,
doAutoGeo = this.settings.autoGeocode,
latlng,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
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,
- Create a ticketCreate a ticket
Function init
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function () {
var _this = this;
this.writeDebug('init');
// Calculate geocode distance functions
if (this.settings.lengthUnit === 'km') {
- Create a ticketCreate a ticket
Function _loadTemplates
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>';
- Create a ticketCreate a ticket
Method setLocations
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setLocations(HTTPRequest $request = null)
{
if ($request === null) {
$request = $this->request;
- Create a ticketCreate a ticket
Function _defineLocationData
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_defineLocationData: function (currentMarker, storeStart, page) {
this.writeDebug('_defineLocationData',arguments);
var indicator = '';
this._createLocationVariables(currentMarker.get('id'));
- Create a ticketCreate a ticket
Function setLocations
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
public function setLocations(HTTPRequest $request = null)
{
if ($request === null) {
$request = $this->request;
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function mapping
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mapping: function (mappingObject) {
this.writeDebug('mapping',arguments);
var _this = this;
var orig_lat, orig_lng, geocodeData, origin, originPoint, page;
if (!this.isEmptyObject(mappingObject)) {
- Create a ticketCreate a ticket
Method getCMSFields
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getCMSFields()
{
$this->beforeUpdateCMSFields(function (FieldList $fields) {
$fields->addFieldsToTab(
'Root.Main',
- Create a ticketCreate a ticket
Function autoGeocodeQuery
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
autoGeocodeQuery: function (position) {
this.writeDebug('autoGeocodeQuery',arguments);
var _this = this,
distance = null,
$distanceInput = $('#' + this.settings.maxDistanceID),
- Create a ticketCreate a ticket
Function defaultLocation
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
defaultLocation: function() {
this.writeDebug('defaultLocation');
var _this = this,
distance = null,
$distanceInput = $('#' + this.settings.maxDistanceID),
- Create a ticketCreate a ticket
Function migrateLocations
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function migrateLocations()
{
if (!$parent = Locator::get()->first()) {
$parent = Locator::create();
$parent->Title = "Locator";
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Consider simplifying this complex logical expression. Open
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) {
- Create a ticketCreate a ticket