CrazySquirrel/CSShare

View on GitHub

Showing 85 of 85 total issues

Avoid deeply nested control flow statements.
Open

                            if(optionSize[1]*1 && optionSize[1]*1 > 0){
                                size[1] = optionSize[1]*1;
                            }else{
                                size[1] = defaultSize[1];
                            }
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if(typeof data === "undefined"){data={};}
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if(typeof data === "undefined"){data={};}
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if(typeof data.adaptivMedia === "undefined"){data.adaptivMedia={};}
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                    switch(i){
                                        case "adaptivSize":
                                            if(typeof settings.tiles[data.id][i] !== "undefined"){
                                                for(j in settings.tiles[data.id][i]){
                                                    if(settings.tiles[data.id][i].hasOwnProperty(j)){
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if(typeof data === "undefined"){data={};}
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                for(j in settings[i]){
                                    if(
                                        settings[i].hasOwnProperty(j) &&
                                        base.settings.adaptivMedia.hasOwnProperty(j)
                                    ) {
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if(typeof data === "undefined"){data={};}
Severity: Major
Found in js/jquery.CSShare-1.0.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if(z.length>1){
                                for(k=1;k<z.length;k++){
                                    z[k] = z[k].slice(0,1).toUpperCase() + z[k].slice(1).toLowerCase();
                                }
                            }
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            }else if(typeof data !== "undefined" && typeof data[i] !== "undefined"){
                                for(j in data[i]){
                                    if(
                                        data[i].hasOwnProperty(j) &&
                                        base.settings.adaptivMedia.hasOwnProperty(j)
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if(typeof data.adaptivSize === "undefined"){data.adaptivSize={};}
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            for(i=y;i<y+size[1];i++){
                                for(j=x;j<x+size[0];j++){
                                    if(grid[i][j]){
                                        g = false;
                                        break;
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            for(x=gridSize[0];x>0;x--){
                                for(y=gridSize[0];y>0;y--){
                                    fainder = base.findGridPlace([x,y],grid,false);
                                    if(fainder){
                                        size = [x,y];
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if(z.length>1){
                                for(k=1;k<z.length;k++){
                                    z[k] = z[k].slice(0,1).toUpperCase() + z[k].slice(1).toLowerCase();
                                }
                            }
Severity: Major
Found in js/jquery.CSShare-1.0.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if(typeof data === "undefined"){data={};}
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if(g){
                                f = true;
                                break;    
                            }    
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 45 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                            if(typeof settings !== "undefined" && typeof settings[i] !== "undefined"){
                                base.settings[i] = base.getsize(settings[i],$.CrazySquirrel.Tiles.defaultSettings[i]);
                            }else if(typeof data !== "undefined" && typeof data[i] !== "undefined"){
                                base.settings[i] = base.getsize(data[i],$.CrazySquirrel.Tiles.defaultSettings[i]);
                            }else{
Severity: Minor
Found in js/jquery.CSTiles-1.1.0.js and 1 other location - About 40 mins to fix
js/jquery.CSTiles-1.1.0.js on lines 154..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                            }else if(typeof data !== "undefined" && typeof data[i] !== "undefined"){
                                base.settings[i] = base.getsize(data[i],$.CrazySquirrel.Tiles.defaultSettings[i]);
                            }else{
                                base.settings[i] = $.CrazySquirrel.Tiles.defaultSettings[i];
                            }
Severity: Minor
Found in js/jquery.CSTiles-1.1.0.js and 1 other location - About 40 mins to fix
js/jquery.CSTiles-1.1.0.js on lines 152..158

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function makeTile has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        base.makeTile = function(e,setting,grid,gridscale,gridSize){
Severity: Minor
Found in js/jquery.CSTiles-1.1.0.js - About 35 mins to fix

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.

Severity
Category
Status
Source
Language