thiagopradi/octopus

View on GitHub

Showing 170 of 237 total issues

File prototype.js has 4031 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*  Prototype JavaScript framework, version 1.6.1
 *  (c) 2005-2009 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
Severity: Major
Found in sample_app/public/javascripts/prototype.js - About 1 wk to fix

    File effects.js has 1014 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // script.aculo.us effects.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
    
    // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
    // Contributors:
    //  Justin Palmer (http://encytemedia.com/)
    Severity: Major
    Found in sample_app/public/javascripts/effects.js - About 2 days to fix

      File controls.js has 804 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
      
      // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
      //           (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
      //           (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
      Severity: Major
      Found in sample_app/public/javascripts/controls.js - About 1 day to fix

        File dragdrop.js has 786 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // script.aculo.us dragdrop.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
        
        // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
        //
        // script.aculo.us is freely distributable under the terms of an MIT-style license.
        Severity: Major
        Found in sample_app/public/javascripts/dragdrop.js - About 1 day to fix

          Function id has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
          Open

              id: function(nodes, root, id, combinator) {
                var targetNode = $(id), h = Selector.handlers;
          
                if (root == document) {
                  if (!targetNode) return [];
          Severity: Minor
          Found in sample_app/public/javascripts/prototype.js - About 1 day 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 Enumerable has 209 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Enumerable = (function() {
            function each(iterator, context) {
              var index = 0;
              try {
                this._each(function(value) {
          Severity: Major
          Found in sample_app/public/javascripts/prototype.js - About 1 day to fix

            Methods has 56 functions (exceeds 20 allowed). Consider refactoring.
            Open

            Element.Methods = {
              visible: function(element) {
                return $(element).style.display != 'none';
              },
            
            
            Severity: Major
            Found in sample_app/public/javascripts/prototype.js - About 1 day to fix

              Class Proxy has 44 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class Proxy
                  attr_accessor :proxy_config
              
                  delegate :current_model, :current_model=,
                           :current_shard, :current_shard=,
              Severity: Minor
              Found in lib/octopus/proxy.rb - About 6 hrs to fix

                Function addMethods has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                Element.addMethods = function(methods) {
                  var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
                
                  if (!methods) {
                    Object.extend(Form, Form.Methods);
                Severity: Minor
                Found in sample_app/public/javascripts/prototype.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 update has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                  update: (function(){
                
                    var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
                      var el = document.createElement("select"),
                          isBuggy = true;
                Severity: Minor
                Found in sample_app/public/javascripts/prototype.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 nth has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                    nth: function(nodes, formula, root, reverse, ofType) {
                      if (nodes.length == 0) return [];
                      if (formula == 'even') formula = '2n+0';
                      if (formula == 'odd')  formula = '2n+1';
                      var h = Selector.handlers, results = [], indexed = [], m;
                Severity: Minor
                Found in sample_app/public/javascripts/prototype.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 setOptions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                  setOptions: function(options) {
                    this.options = Object.extend({
                      choices: 10,
                      partialSearch: true,
                      partialChars: 2,
                Severity: Minor
                Found in sample_app/public/javascripts/controls.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 start has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                  start: function(options) {
                    if (options && options.transition === false) options.transition = Effect.Transitions.linear;
                    this.options      = Object.extend(Object.extend({ },Effect.DefaultOptions), options || { });
                    this.currentFrame = 0;
                    this.state        = 'idle';
                Severity: Minor
                Found in sample_app/public/javascripts/effects.js - About 3 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 Hash has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var Hash = Class.create(Enumerable, (function() {
                  function initialize(object) {
                    this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
                  }
                
                
                Severity: Major
                Found in sample_app/public/javascripts/prototype.js - About 3 hrs to fix

                  Function create has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    create: function(element) {
                      element = $(element);
                      var options = Object.extend({
                        element:     element,
                        tag:         'li',       // assumes li children, override with tag: 'tagname'
                  Severity: Major
                  Found in sample_app/public/javascripts/dragdrop.js - About 3 hrs to fix

                    Function getStyle has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                      Element.Methods.getStyle = function(element, style) {
                        element = $(element);
                        style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
                        var value = element.style[style];
                        if (!value && element.currentStyle) value = element.currentStyle[style];
                    Severity: Minor
                    Found in sample_app/public/javascripts/prototype.js - About 3 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 serializeElements has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                      serializeElements: function(elements, options) {
                        if (typeof options != 'object') options = { hash: !!options };
                        else if (Object.isUndefined(options.hash)) options.hash = true;
                        var key, value, submitted = false, submit = options.submit;
                    
                    
                    Severity: Minor
                    Found in sample_app/public/javascripts/prototype.js - About 3 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 addMethods has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Element.addMethods = function(methods) {
                      var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
                    
                      if (!methods) {
                        Object.extend(Form, Form.Methods);
                    Severity: Major
                    Found in sample_app/public/javascripts/prototype.js - About 3 hrs to fix

                      Function _attributeTranslations has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        Element._attributeTranslations = (function(){
                      
                          var classProp = 'className';
                          var forProp = 'for';
                      
                      
                      Severity: Major
                      Found in sample_app/public/javascripts/prototype.js - About 3 hrs to fix

                        Class ProxyConfig has 26 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class ProxyConfig
                            CURRENT_MODEL_KEY = 'octopus.current_model'.freeze
                            CURRENT_SHARD_KEY = 'octopus.current_shard'.freeze
                            CURRENT_GROUP_KEY = 'octopus.current_group'.freeze
                            CURRENT_SLAVE_GROUP_KEY = 'octopus.current_slave_group'.freeze
                        Severity: Minor
                        Found in lib/octopus/proxy_config.rb - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language