kandanapp/kandan

View on GitHub

Showing 44 of 68 total issues

File backbone.js has 929 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//     Backbone.js 1.0.0

//     (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:
Severity: Major
Found in app/assets/javascripts/lib/backbone.js - About 2 days to fix

    Function Modernizr has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
    Open

    window.Modernizr = (function( window, document, undefined ) {
    
        var version = '2.8.3',
    
        Modernizr = {},
    Severity: Minor
    Found in app/assets/javascripts/lib/modernizr.js - About 2 days 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

    File underscore.js has 848 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    //     Underscore.js 1.4.4
    //     http://underscorejs.org
    //     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
    //     Underscore may be freely distributed under the MIT license.
    
    
    Severity: Major
    Found in app/assets/javascripts/lib/underscore.js - About 2 days to fix

      Function Modernizr has 379 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      window.Modernizr = (function( window, document, undefined ) {
      
          var version = '2.8.3',
      
          Modernizr = {},
      Severity: Major
      Found in app/assets/javascripts/lib/modernizr.js - About 1 day to fix

        Function filedrop has 324 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          $.fn.filedrop = function(options) {
            var opts = $.extend({}, default_opts, options),
                global_progress = [];
        
            $(document).on('drop', this, drop).on('dragstart', this, opts.dragStart).on('dragenter',this, dragEnter).on('dragover', this, dragOver).on('dragleave', this, dragLeave);
        Severity: Major
        Found in app/assets/javascripts/lib/jquery.filedrop.js - About 1 day to fix

          File jquery.atwho.js has 570 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          /*
            Implement Github like autocomplete mentions
            http://ichord.github.com/At.js
          
          
          Severity: Major
          Found in app/assets/javascripts/lib/jquery.atwho.js - About 1 day to fix

            File underscore.string.js has 464 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            //  Underscore.string
            //  (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
            //  Underscore.string is freely distributable under the terms of the MIT license.
            //  Documentation: https://github.com/epeli/underscore.string
            //  Some code is borrowed from MooTools and Alexandru Marasteanu.
            Severity: Minor
            Found in app/assets/javascripts/lib/underscore.string.js - About 7 hrs to fix

              Function upload has 173 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function upload() {
                    stop_loop = false;
              
                    if (!files) {
                      opts.error(errors[0]);
              Severity: Major
              Found in app/assets/javascripts/lib/jquery.filedrop.js - About 6 hrs to fix

                File modernizr.js has 384 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* Modernizr 2.8.3 (Custom Build) | MIT & BSD
                 * Build: http://modernizr.com/download/#-draganddrop-audio-touch-shiv-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-notification
                 */
                ;
                
                
                Severity: Minor
                Found in app/assets/javascripts/lib/modernizr.js - About 5 hrs to fix

                  File jquery.filedrop.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*global jQuery:false, alert:false */
                  
                  /*
                   * Default text - jQuery plugin for html5 dragging files from desktop to browser
                   *
                  Severity: Minor
                  Found in app/assets/javascripts/lib/jquery.filedrop.js - About 5 hrs to fix

                    Function toRelativeTime has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                     Date.prototype.toRelativeTime = (function() {
                    
                      var _ = function(options) {
                        var opts = processOptions(options);
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/lib/date.extensions.js - About 4 hrs 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

                    Function sprintf has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var sprintf = (function() {
                        function get_type(variable) {
                          return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
                        }
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/lib/underscore.string.js - About 4 hrs to fix

                      Function send has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            var send = function(e) {
                      
                              var fileIndex = ((typeof(e.srcElement) === "undefined") ? e.target : e.srcElement).index;
                      
                              // Sometimes the index is not attached to the
                      Severity: Major
                      Found in app/assets/javascripts/lib/jquery.filedrop.js - About 3 hrs to fix

                        Function process has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              var process = function() {
                        
                                var fileIndex;
                        
                                if (stop_loop) {
                        Severity: Major
                        Found in app/assets/javascripts/lib/jquery.filedrop.js - About 2 hrs to fix

                          Function eq has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            var eq = function(a, b, aStack, bStack) {
                              // Identical objects are equal. `0 === -0`, but they aren't identical.
                              // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
                              if (a === b) return a !== 0 || 1 / a == 1 / b;
                              // A strict comparison is necessary because `null == undefined`.
                          Severity: Major
                          Found in app/assets/javascripts/lib/underscore.js - About 2 hrs to fix

                            Function toRelativeTime has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                             Date.prototype.toRelativeTime = (function() {
                            
                              var _ = function(options) {
                                var opts = processOptions(options);
                            
                            
                            Severity: Major
                            Found in app/assets/javascripts/lib/date.extensions.js - About 2 hrs to fix

                              Function set has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  set: function(key, val, options) {
                                    var attr, attrs, unset, changes, silent, changing, prev, current;
                                    if (key == null) return this;
                              
                                    // Handle both `"key", value` and `{key: value}` -style arguments.
                              Severity: Minor
                              Found in app/assets/javascripts/lib/backbone.js - About 1 hr to fix

                                Function format has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    str_format.format = function(parse_tree, argv) {
                                      var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
                                      for (i = 0; i < tree_length; i++) {
                                        node_type = get_type(parse_tree[i]);
                                        if (node_type === 'string') {
                                Severity: Minor
                                Found in app/assets/javascripts/lib/underscore.string.js - About 1 hr to fix

                                  Function set has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      set: function(models, options) {
                                        options = _.defaults(options || {}, setOptions);
                                        if (options.parse) models = this.parse(models, options);
                                        if (!_.isArray(models)) models = models ? [models] : [];
                                        var i, l, model, attrs, existing, sort;
                                  Severity: Minor
                                  Found in app/assets/javascripts/lib/backbone.js - About 1 hr to fix

                                    Function parse has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        str_format.parse = function(fmt) {
                                          var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
                                          while (_fmt) {
                                            if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
                                              parse_tree.push(match[0]);
                                    Severity: Minor
                                    Found in app/assets/javascripts/lib/underscore.string.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language