CrazySquirrel/CSShare

View on GitHub

Showing 27 of 85 total issues

Function Tiles has 506 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.CrazySquirrel.Tiles = function(that, settings){
        /**
         * Pointer to this object
         * @type {object}
         */
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 2 days to fix

File jquery.CSTiles-1.1.0.js has 546 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * CrazySquirrel
 * http://crazysquirrel.ru/
 *
 * @author Yastrebov Sergey
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 1 day to fix

Function Init has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        base.Init = function(){
            var i,j,x;
            
            var data = base.getSettingsFromData(base.that);
    
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 5 hrs to fix

Function Share has 137 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.CrazySquirrel.Share = function(that, settings){
        var i,x;
        /**
         * Pointer to this object
         * @type {object}
Severity: Major
Found in js/jquery.CSShare-1.0.0.js - About 5 hrs to fix

Function Build has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        base.Build = function(){
            var i,j,k,h,g,x,y,z,e,image,media,gridSize,tiles,height,grid,size,padding,margin,_height,fainder,html,make;
            
            for(i in base.settings.adaptivMedia){
                if(base.settings.adaptivMedia.hasOwnProperty(i)){
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 4 hrs to fix

Function makeTile has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        base.makeTile = function(e,setting,grid,gridscale,gridSize){
            var j,x,image,size,padding,height,finder,margin;
            e.html("<div class='cstiles__item-content-wrap' style='padding:"+setting.margin+"px;'><div class='cstiles__item-content'>"+e.html()+"</div></div>");
            image = e.find(".cstiles__item-image:first");
            if(image.size()>0||setting.imageSrc){
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 2 hrs to fix

Function findGridPlace has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        base.findGridPlace = function(size,grid,scale){
            var x,y,z,i,j,f,g,a;
            z = 0;
            do{
                z++;
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 2 hrs to fix

Function getSettingsFromData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        base.getSettingsFromData = function(that){
            var i,j,k,x,y,z;
            var attrs = that.attributes;
            var data;
            if(typeof attrs !== "undefined"){
Severity: Major
Found in js/jquery.CSTiles-1.1.0.js - About 2 hrs to fix

Function getSettingsFromData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        base.getSettingsFromData = function(that){
            var i,j,k,x,y,z;
            var attrs = that.attributes;
            var data;
            if(typeof attrs !== "undefined"){
Severity: Minor
Found in js/jquery.CSShare-1.0.0.js - About 1 hr to fix

Function getsize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        base.getsize = function(optionSize,defaultSize){
            var size = [];
            if(optionSize){
                if(Array.isArray(optionSize)){
                    if(optionSize.length === 0){
Severity: Minor
Found in js/jquery.CSTiles-1.1.0.js - About 1 hr 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

                            }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(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

                                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(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(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

                                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

                                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

                                    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(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
Severity
Category
Status
Source
Language