Showing 29 of 35 total issues
Function addFeatureOptions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
addFeatureOptions(features:{}[], options?:featureOption):void {
var feature, x;
for (x in features) {
if (features.hasOwnProperty(x)) {
- Read upRead up
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 constructor
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options: mapToolsOptions, cb: mapToolsCallback) {
var addMarkerInstance = new addMarker(this);
Function onSuccess
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
onSuccess(options, position, panel, cb) {
var e, rule;
// positioning options
- Read upRead up
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 clone
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static clone(o: {}, exceptionKeys?: string[]): utilsClone {
var out, v, key;
out = Array.isArray(o) ? [] : {};
for (key in o) {
if (o.hasOwnProperty(key)) {
- Read upRead up
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 create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
create(args, cb) {
cb = cb || function () {};
var mapOptions = maps.mapOptions(args);
- Read upRead up
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 customUpdate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public customUpdate(marker, options) {
if (options.custom) {
if (options.custom.move) {
marker.setAnimation(google.maps.Animation[options.custom.move.toUpperCase()]);
- Read upRead up
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 filter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public filter(args, options?) {
// Return All items if no arguments are supplied
if (typeof args === 'undefined' && typeof options === 'undefined') {
return this.utils.toArray(this.that[this.type].all);
- Read upRead up
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 onSuccess
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
onSuccess(options, position, panel, cb) {
var e, rule;
// positioning options
Function filter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public filter(args, options?) {
// Return All items if no arguments are supplied
if (typeof args === 'undefined' && typeof options === 'undefined') {
return this.utils.toArray(this.that[this.type].all);
Function create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(args, cb) {
cb = cb || function () {};
var mapOptions = maps.mapOptions(args);
Function addMarker
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public addMarker(args, options) {
if (utils.isArray(args)) {
if (args.length >= 1) {
var marker, markers = [];
for (var i in args) {
- Read upRead up
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 addFilter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public addFilter(filters) {
this.that[this.type].crossfilter = this.that[this.type].crossfilter || this.that.crossfilter([]);
this.that[this.type].filter = this.that[this.type].filter || {};
- Read upRead up
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 _addMarker
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private _addMarker(marker, options): {} {
marker.map = this.that.instance;
marker.position = new google.maps.LatLng(marker.lat, marker.lng);
Function _addMarker
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private _addMarker(marker, options): {} {
marker.map = this.that.instance;
marker.position = new google.maps.LatLng(marker.lat, marker.lng);
- Read upRead up
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 filterByTag
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
filterByTag(query) {
// if the search query is an array with only one item then just use that string
if(this.utils.isArray(query) && query.length === 1){
query = query[0];
}
- Read upRead up
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 addMarkerByTag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
addMarkerByTag(marker, instance) {
if (utils.isArray(marker.tags)) {
var i, tag;
for (i in marker.tags) {
- Read upRead up
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 prepareOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static prepareOptions(options, custom) : {custom: {open?: {on: string}; close?: {on: string; duration: number}}; defaults: {}} {
var result = {custom: {}, defaults: {}}, option;
for (option in options) {
if (options.hasOwnProperty(option)) {
if (custom.indexOf(option) > -1) {
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if (!this.that.json.filter) {
this.addFilter(options.filters);
}
Function removeTags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
removeTags(marker) {
if (utils.isArray(marker.tags)) {
var i, tag;
for (i in marker.tags) {
if (marker.tags.hasOwnProperty(i)) {
- Read upRead up
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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public update(args, options){
var type = Object.prototype.toString.call(args);
if (type === '[object Array]') {
var feature, x;
- Read upRead up
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"