felipero/couchrails

View on GitHub

Showing 149 of 206 total issues

Function update has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  update: (function(){

    var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
      var el = document.createElement("select"),
          isBuggy = true;
Severity: Major
Found in examples/helloworld/public/javascripts/prototype.js - About 2 hrs to fix

    Function _attributeTranslations has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

      Element._attributeTranslations = (function(){
    
        var classProp = 'className';
        var forProp = 'for';
    
    
    Severity: Minor
    Found in examples/helloworld/public/javascripts/prototype.js - About 2 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 extend has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    Element.extend = (function() {
    
      function checkDeficiency(tagName) {
        if (typeof window.Element != 'undefined') {
          var proto = window.Element.prototype;
    Severity: Minor
    Found in examples/helloworld/public/javascripts/prototype.js - About 2 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 Grow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Effect.Grow = function(element) {
      element = $(element);
      var options = Object.extend({
        direction: 'center',
        moveTransition: Effect.Transitions.sinoidal,
    Severity: Major
    Found in examples/helloworld/public/javascripts/effects.js - About 2 hrs to fix

      InPlaceEditor has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      Ajax.InPlaceEditor = Class.create({
        initialize: function(element, url, options) {
          this.url = url;
          this.element = element = $(element);
          this.prepareOptions();
      Severity: Minor
      Found in examples/helloworld/public/javascripts/controls.js - About 2 hrs to fix

        Base has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        Autocompleter.Base = Class.create({
          baseInitialize: function(element, update, options) {
            element          = $(element);
            this.element     = element;
            this.update      = $(update);
        Severity: Minor
        Found in examples/helloworld/public/javascripts/controls.js - About 2 hrs to fix

          Function tagName has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              tagName: function(nodes, root, tagName, combinator) {
                var uTagName = tagName.toUpperCase();
                var results = [], h = Selector.handlers;
                if (nodes) {
                  if (combinator) {
          Severity: Minor
          Found in examples/helloworld/public/javascripts/prototype.js - About 2 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 setDimensions has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

            setDimensions: function(height, width) {
              var d = { };
              if (this.options.scaleX) d.width = width.round() + 'px';
              if (this.options.scaleY) d.height = height.round() + 'px';
              if (this.options.scaleFromCenter) {
          Severity: Minor
          Found in examples/helloworld/public/javascripts/effects.js - About 2 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 parseColor has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          String.prototype.parseColor = function() {
            var color = '#';
            if (this.slice(0,4) == 'rgb(') {
              var cols = this.slice(4,this.length-1).split(',');
              var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
          Severity: Minor
          Found in examples/helloworld/public/javascripts/effects.js - About 2 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 setup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

            setup: function(){
              function parseColor(color){
                if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
                color = color.parseColor();
                return $R(0,2).map(function(i){
          Severity: Minor
          Found in examples/helloworld/public/javascripts/effects.js - About 2 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 extend has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Element.extend = (function() {
          
            function checkDeficiency(tagName) {
              if (typeof window.Element != 'undefined') {
                var proto = window.Element.prototype;
          Severity: Major
          Found in examples/helloworld/public/javascripts/prototype.js - About 2 hrs to fix

            Function finishDrag has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              finishDrag: function(event, success) {
                this.dragging = false;
            
                if(this.options.quiet){
                  Position.prepare();
            Severity: Minor
            Found in examples/helloworld/public/javascripts/dragdrop.js - About 2 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 onEmptyHover has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              onEmptyHover: function(element, dropon, overlap) {
                var oldParentNode = element.parentNode;
                var droponOptions = Sortable.options(dropon);
            
                if(!Element.isParent(dropon, element)) {
            Severity: Minor
            Found in examples/helloworld/public/javascripts/dragdrop.js - About 2 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 Class has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Class = (function() {
              function subclass() {};
              function create() {
                var parent = null, properties = $A(arguments);
                if (Object.isFunction(properties[0]))
            Severity: Major
            Found in examples/helloworld/public/javascripts/prototype.js - About 2 hrs to fix

              Function index has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  index: function(parentNode, reverse, ofType) {
                    parentNode._countedByPrototype = Prototype.emptyFunction;
                    if (reverse) {
                      for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
                        var node = nodes[i];
              Severity: Minor
              Found in examples/helloworld/public/javascripts/prototype.js - About 2 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 insert has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                insert: function(element, insertions) {
                  element = $(element);
              
                  if (Object.isString(insertions) || Object.isNumber(insertions) ||
                      Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
              Severity: Minor
              Found in examples/helloworld/public/javascripts/prototype.js - About 2 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 updateDrag has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                updateDrag: function(event, pointer) {
                  if(!this.dragging) this.startDrag(event);
              
                  if(!this.options.quiet){
                    Position.prepare();
              Severity: Minor
              Found in examples/helloworld/public/javascripts/dragdrop.js - About 2 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 initialize has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                initialize: function(element) {
                  var defaults = {
                    handle: false,
                    reverteffect: function(element, top_offset, left_offset) {
                      var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
              Severity: Minor
              Found in examples/helloworld/public/javascripts/dragdrop.js - About 2 hrs to fix

                Function Shrink has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Effect.Shrink = function(element) {
                  element = $(element);
                  var options = Object.extend({
                    direction: 'center',
                    moveTransition: Effect.Transitions.sinoidal,
                Severity: Minor
                Found in examples/helloworld/public/javascripts/effects.js - About 1 hr to fix

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

                      function(proceed, element, style) {
                        switch (style) {
                          case 'left': case 'top': case 'right': case 'bottom':
                            if (proceed(element, 'position') === 'static') return null;
                          case 'height': case 'width':
                  Severity: Minor
                  Found in examples/helloworld/public/javascripts/prototype.js - About 1 hr 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

                  Severity
                  Category
                  Status
                  Source
                  Language