CrazySquirrel/CSTiles

View on GitHub

Showing 76 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":
Severity: Minor
Found in src/ts/Modules/CSTiles.ts - About 1 hr to fix

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 (
Severity: Minor
Found in src/ts/Modules/CSTiles.ts - About 55 mins to fix

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 (isFunded) {
                            break;
                        }
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

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 || {};
Severity: Minor
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

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 (r) {
                            adaptiveGrid[strMediaName] = r.grid;
                            arrTiles[objTileID].tileAdaptivePosition[strMediaName] = [r.x, r.y];
                        }
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        for (let _strRule of arrRules) {
                            if (objCssProperties[_strRule]) {
                                arrCompiledRules.push(objCssProperties[_strRule]);
                                delete objCssProperties[_strRule];
                            }
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

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]);
                            }
                        }
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (strCompiledRules) {
                            objCssProperties[strCompiledRule].push(strCompiledRules);
                        }
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                if (
                    strCssPropertyValue[0] === strCssPropertyValue[1] &&
                    strCssPropertyValue[1] === strCssPropertyValue[2] &&
                    strCssPropertyValue[2] === strCssPropertyValue[3]
                ) {
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

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;`;
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

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]) {
Severity: Major
Found in src/ts/Modules/CSTiles.ts - About 45 mins to fix

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" &&
Severity: Minor
Found in src/ts/Modules/CSTiles.ts - About 35 mins to fix

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

debug Regular Expression Denial of Service
Open

        "debug": {
          "version": "2.2.0",
          "dependencies": {
            "ms": {
              "version": "0.7.1"
Severity: Minor
Found in npm-shrinkwrap.json by nodesecurity

Regular Expression Denial of Service

Overview:

The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

Recommendation:

Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

debug Regular Expression Denial of Service
Open

        "debug": {
          "version": "2.2.0",
          "dependencies": {
            "ms": {
              "version": "0.7.1"
Severity: Minor
Found in npm-shrinkwrap.json by nodesecurity

Regular Expression Denial of Service

Overview:

The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

Recommendation:

Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.

Trailing spaces
Open

            
Severity: Info
Found in README.md by markdownlint

MD009 - Trailing spaces

Tags: whitespace

Aliases: no-trailing-spaces

Parameters: br_spaces (number; default: 0)

This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

Trailing spaces
Open

                    
Severity: Info
Found in README.md by markdownlint

MD009 - Trailing spaces

Tags: whitespace

Aliases: no-trailing-spaces

Parameters: br_spaces (number; default: 0)

This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

Trailing spaces
Open

                    
Severity: Info
Found in README.md by markdownlint

MD009 - Trailing spaces

Tags: whitespace

Aliases: no-trailing-spaces

Parameters: br_spaces (number; default: 0)

This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

Trailing spaces
Open

      
Severity: Info
Found in README.md by markdownlint

MD009 - Trailing spaces

Tags: whitespace

Aliases: no-trailing-spaces

Parameters: br_spaces (number; default: 0)

This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

Trailing spaces
Open

        
Severity: Info
Found in README.md by markdownlint

MD009 - Trailing spaces

Tags: whitespace

Aliases: no-trailing-spaces

Parameters: br_spaces (number; default: 0)

This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

Trailing spaces
Open

        
Severity: Info
Found in README.md by markdownlint

MD009 - Trailing spaces

Tags: whitespace

Aliases: no-trailing-spaces

Parameters: br_spaces (number; default: 0)

This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

Severity
Category
Status
Source
Language