Showing 32 of 76 total issues
Function insertContent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static insertContent(domParentNode: HTMLElement,
objContent: any,
arrCss: Object) {
switch (objContent.type) {
case "none":
- Create a ticketCreate a ticket
Function checkInnerParamsForErrors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static checkInnerParamsForErrors(domParentNode?: HTMLElement,
objGridParams?: CGridParams,
arrTiles?: Array<CTileParams>) {
let isError = false;
if (
- 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 assignAdaptive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static assignAdaptive(objObject: Object,
arrAdaptiveMedia: Object,
strPropertyFrom: string,
strPropertyTo: string): any {
objObject = objObject || {};
- 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
Avoid deeply nested control flow statements. Open
for (x = 0; x <= grid[y].length - tileSize[0]; x++) {
let ifGap = true;
for (i = y; i < y + tileSize[1]; i++) {
for (j = x; j < x + tileSize[0]; j++) {
if (grid[i][j]) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (arrCss[strMedia].hasOwnProperty(strBlockID)) {
strCss += `#${strBlockID} {`;
for (let strCssProperty in arrCss[strMedia][strBlockID]) {
if (arrCss[strMedia][strBlockID].hasOwnProperty(strCssProperty)) {
strCss += `${strCssProperty}: ${arrCss[strMedia][strBlockID][strCssProperty]} !important;`;
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (isFunded) {
break;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for (let strCssProperty in arrCss[strMedia][strBlockID]) {
if (arrCss[strMedia][strBlockID].hasOwnProperty(strCssProperty)) {
arrCss[strMedia][strBlockID][strCssProperty] = CSTiles.optimizeCssProperty(strCssProperty, arrCss[strMedia][strBlockID][strCssProperty]);
}
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (strCompiledRules) {
objCssProperties[strCompiledRule].push(strCompiledRules);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (r) {
adaptiveGrid[strMediaName] = r.grid;
arrTiles[objTileID].tileAdaptivePosition[strMediaName] = [r.x, r.y];
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for (let _strRule of arrRules) {
if (objCssProperties[_strRule]) {
arrCompiledRules.push(objCssProperties[_strRule]);
delete objCssProperties[_strRule];
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (
strCssPropertyValue[0] === strCssPropertyValue[1] &&
strCssPropertyValue[1] === strCssPropertyValue[2] &&
strCssPropertyValue[2] === strCssPropertyValue[3]
) {
- Create a ticketCreate a ticket
Function isInstanceOf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static isInstanceOf(objFirstObject: Object,
objSecondObject: Object): boolean {
if (
!(
typeof objFirstObject === "object" &&
- 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"