Showing 21 of 23 total issues
Function generateArrayUtils
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function generateArrayUtils(target = {}) {
const isTargetPrototype = target === Array.prototype;
const staticTarget = isTargetPrototype ? Array : target;
staticTarget.subArray = function(array, from = 0, to = array.length) {
- 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 setConstants
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
exports.setConstants = (function () {
let pattern = new RegExp("^<%= .* %>$");
let loadOptions = (data, key = "") => {
const options = {};
const templates = {};
- 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 generateObjectUtils
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function generateObjectUtils(target = {}) {
const isTargetPrototype = target === Object.prototype;
const staticTarget = isTargetPrototype ? Object : target;
staticTarget.without = function(obj, items) {
- 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 generateArrayUtils
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateArrayUtils(target = {}) {
const isTargetPrototype = target === Array.prototype;
const staticTarget = isTargetPrototype ? Array : target;
staticTarget.subArray = function(array, from = 0, to = array.length) {
Function generateStringUtils
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateStringUtils(target = {}) {
const isTargetPrototype = target === String.prototype;
const staticTarget = isTargetPrototype ? String : target;
staticTarget.between = function(text, key1, key2) {
Function generateStringUtils
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function generateStringUtils(target = {}) {
const isTargetPrototype = target === String.prototype;
const staticTarget = isTargetPrototype ? String : target;
staticTarget.between = function(text, key1, key2) {
- 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 setConstants
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.setConstants = (function () {
let pattern = new RegExp("^<%= .* %>$");
let loadOptions = (data, key = "") => {
const options = {};
const templates = {};
Function roughSizeOfObject
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
exports.roughSizeOfObject = function (object) {
const objectList = [];
const stack = [object];
let bytes = 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 generateObjectUtils
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateObjectUtils(target = {}) {
const isTargetPrototype = target === Object.prototype;
const staticTarget = isTargetPrototype ? Object : target;
staticTarget.without = function(obj, items) {
Function where
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static where(array: any[], condition: any[]): any[] {
const result: any[] = [];
for (let i = 0 ; i < array.length ; i++) {
let add = true;
for (const key in condition) {
- 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 loadOptions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
let loadOptions = (data, key = "") => {
const options = {};
const templates = {};
let actualKey;
Function roughSizeOfObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static roughSizeOfObject(object: any): number {
const objectList = [];
const stack = [object];
let bytes = 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 GElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.GElement = function(element) {
return {
getId: function() {
return element.id;
Consider simplifying this complex logical expression. Open
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(a => success({
accularity: a.coords && a.coords.accuracy || "unknown",
latitude : a.coords && a.coords.latitude || "unknown",
longitude : a.coords && a.coords.longitude || "unknown"
Function getLocation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.getLocation = function() {
return new Promise((success, reject) => {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(a => success({
accularity: a.coords && a.coords.accuracy || "unknown",
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(arg1, arg2, arg3){//ARGUMENT JE CANVAS ELEMENT
if(arg1 instanceof HTMLCanvasElement){
this._canvas = arg1;
if(arg2 && arg3){
this.setCanvasSize(arg2, arg3);
- 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 isIn
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static isIn (obj, data) {
if (Array.isArray(data)) {
if (data.indexOf(obj) >= 0) {
return true;
}
- 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 objectToQueryParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static objectToQueryParams(obj: StringMap): string {
// TODO: add url prefix
let result = "";
for (const objKey in obj) {
if (obj.hasOwnProperty(objKey)) {
- 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 objectToQueryParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.objectToQueryParams = function (obj) {
let result = "";
for (const objKey in obj) {
if (obj.hasOwnProperty(objKey)) {
result += (result.length > 0 ? "&" : "?") + objKey + "=" + obj[objKey];
- 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 isPlain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static isPlain(object: any): boolean {
for (const index in object) {
if (object.hasOwnProperty(index)) {
if (typeof object[index] === "undefined") {
return false;
- 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"