kandanapp/kandan

View on GitHub

Showing 68 of 68 total issues

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

    save: function(key, val, options) {
      var attrs, method, xhr, attributes = this.attributes;

      // Handle both `"key", value` and `{key: value}` -style arguments.
      if (key == null || typeof key === 'object') {
Severity: Minor
Found in app/assets/javascripts/lib/backbone.js - About 1 hr to fix

    Function injectElementWithStyles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        injectElementWithStyles = function( rule, callback, nodes, testnames ) {
    
          var style, ret, node, docOverflow,
              div = document.createElement('div'),
                    body = document.body,
    Severity: Minor
    Found in app/assets/javascripts/lib/modernizr.js - About 1 hr to fix

      Function rect has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            Controller.prototype.rect = function() {
              var $inputor, Sel, at_rect, bottom, format, html, offset, start_range, x, y;
              $inputor = this.$inputor;
              if (document.selection) {
                Sel = document.selection.createRange();
      Severity: Minor
      Found in app/assets/javascripts/lib/jquery.atwho.js - About 1 hr to fix

        Function onload has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                xhr.onload = function() {
                    var serverResponse = null;
        
                    if (xhr.responseText) {
                      try {
        Severity: Minor
        Found in app/assets/javascripts/lib/jquery.filedrop.js - About 1 hr to fix

          Function on_keydown has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                Controller.prototype.on_keydown = function(e) {
                  if (!this.view.visible()) {
                    return;
                  }
                  switch (e.keyCode) {
          Severity: Minor
          Found in app/assets/javascripts/lib/jquery.atwho.js - About 1 hr to fix

            Function catch_query has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  Controller.prototype.catch_query = function() {
                    var caret_pos, content, end, query, start, subtext,
                      _this = this;
                    content = this.$inputor.val();
                    caret_pos = this.$inputor.caretPos();
            Severity: Minor
            Found in app/assets/javascripts/lib/jquery.atwho.js - About 1 hr to fix

              Method check_external_avatar has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def check_external_avatar
                  # avatar url is not required
                  return if self.avatar_url.blank?
              
                  uri = URI(avatar_url)
              Severity: Minor
              Found in app/models/user.rb - About 1 hr to fix

                Function isEventSupported has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    isEventSupported = (function() {
                
                      var TAGNAMES = {
                        'select': 'input', 'change': 'input',
                        'submit': 'form', 'reset': 'form',
                Severity: Minor
                Found in app/assets/javascripts/lib/modernizr.js - About 1 hr to fix

                  Function bind has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        Function.prototype.bind = function bind(that) {
                  
                          var target = this;
                  
                          if (typeof target != "function") {
                  Severity: Minor
                  Found in app/assets/javascripts/lib/modernizr.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  if (!arg.hasOwnProperty(match[2][k])) {
                                    throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k]));
                                  }
                    Severity: Major
                    Found in app/assets/javascripts/lib/underscore.string.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
                                      if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
                                        field_list.push(field_match[1]);
                                      }
                                      else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
                      Severity: Major
                      Found in app/assets/javascripts/lib/underscore.string.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
                                          (context && context !== ev.context)) {
                                        retain.push(ev);
                                      }
                        Severity: Major
                        Found in app/assets/javascripts/lib/backbone.js - About 45 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
                                params.contentType = 'application/json';
                                params.data = JSON.stringify(options.attrs || model.toJSON(options));
                              }
                          Severity: Major
                          Found in app/assets/javascripts/lib/backbone.js - About 40 mins to fix

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

                                underscored: function(str){
                                  return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
                                },
                            Severity: Minor
                            Found in app/assets/javascripts/lib/underscore.string.js and 1 other location - About 35 mins to fix
                            app/assets/javascripts/lib/underscore.string.js on lines 318..320

                            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 47.

                            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

                                dasherize: function(str){
                                  return _s.trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase();
                                },
                            Severity: Minor
                            Found in app/assets/javascripts/lib/underscore.string.js and 1 other location - About 35 mins to fix
                            app/assets/javascripts/lib/underscore.string.js on lines 314..316

                            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 47.

                            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 (options.next(e)) {
                                      if (history.hasNext()) {
                                        _this.val(history.next())
                                      }
                                      e.preventDefault();
                            Severity: Minor
                            Found in app/assets/javascripts/lib/jquery.inputHistory.js and 1 other location - About 35 mins to fix
                            app/assets/javascripts/lib/jquery.inputHistory.js on lines 139..153

                            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 46.

                            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 (options.prev(e)) {
                                      if (history.hasPrev()) {
                                        _this.val(history.prev());
                                      }
                                      e.preventDefault();
                            Severity: Minor
                            Found in app/assets/javascripts/lib/jquery.inputHistory.js and 1 other location - About 35 mins to fix
                            app/assets/javascripts/lib/jquery.inputHistory.js on lines 144..153

                            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 46.

                            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

                            Avoid too many return statements within this function.
                            Open

                                return result;
                            Severity: Major
                            Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix

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

                                  function docEnter(e) {
                                    clearTimeout(doc_leave_timer);
                                    e.preventDefault();
                                    opts.docEnter.call(this, e);
                                    return false;
                              Severity: Minor
                              Found in app/assets/javascripts/lib/jquery.filedrop.js and 1 other location - About 30 mins to fix
                              app/assets/javascripts/lib/jquery.filedrop.js on lines 473..478

                              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 45.

                              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

                              Avoid too many return statements within this function.
                              Open

                                    if (aStack[length] == a) return bStack[length] == b;
                              Severity: Major
                              Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language