felipero/couchrails

View on GitHub

Showing 149 of 206 total issues

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

  draw: function(point) {
    var pos = this.element.cumulativeOffset();
    if(this.options.ghosting) {
      var r   = Position.realOffset(this.element);
      pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
Severity: Minor
Found in examples/helloworld/public/javascripts/dragdrop.js - About 1 hr to fix

    Function createEditField has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      createEditField: function() {
        var text = (this.options.loadTextURL ? this.options.loadingText : this.getText());
        var fld;
        if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) {
          fld = document.createElement('input');
    Severity: Minor
    Found in examples/helloworld/public/javascripts/controls.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

    Function compileXPathMatcher has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      compileXPathMatcher: function() {
        var e = this.expression, ps = Selector.patterns,
            x = Selector.xpath, le, m, len = ps.length, name;
    
        if (Selector._cache[e]) {
    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

    Function viewportOffset has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      viewportOffset: function(forElement) {
        var valueT = 0, valueL = 0;
    
        var element = forElement;
        do {
    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

    Function respondToReadyState has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      respondToReadyState: function(readyState) {
        var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
    
        if (state == 'Complete') {
          try {
    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

    Function setOpacity has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      Element.Methods.setOpacity = function(element, value) {
        function stripAlpha(filter){
          return filter.replace(/alpha\([^\)]*\)/gi,'');
        }
        element = $(element);
    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

    Function updateChoices has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      updateChoices: function(choices) {
        if(!this.changed && this.hasFocus) {
          this.update.innerHTML = choices;
          Element.cleanWhitespace(this.update);
          Element.cleanWhitespace(this.update.down());
    Severity: Minor
    Found in examples/helloworld/public/javascripts/controls.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

    Function compileMatcher has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      compileMatcher: function() {
        var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
            c = Selector.criteria, le, p, m, len = ps.length, name;
    
        if (Selector._cache[e]) {
    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

    Function not has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          'not': function(m) {
            var e = m[6], p = Selector.patterns,
                x = Selector.xpath, le, v, len = p.length, name;
    
            var exclusion = [];
    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

    Function id has 31 lines of code (exceeds 25 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 examples/helloworld/public/javascripts/prototype.js - About 1 hr to fix

      Function request has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        request: function(url) {
          this.url = url;
          this.method = this.options.method;
          var params = Object.clone(this.options.parameters);
      
      
      Severity: Minor
      Found in examples/helloworld/public/javascripts/prototype.js - About 1 hr to fix

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

            function update(element, content) {
              element = $(element);
        
              if (content && content.toElement)
                content = content.toElement();
        Severity: Minor
        Found in examples/helloworld/public/javascripts/prototype.js - About 1 hr to fix

          Function updateDrag has 29 lines of code (exceeds 25 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 1 hr to fix

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

              scroll: function() {
                var current = new Date();
                var delta = current - this.lastScrolled;
                this.lastScrolled = current;
                if(this.options.scroll == window) {
            Severity: Minor
            Found in examples/helloworld/public/javascripts/dragdrop.js - About 1 hr to fix

              Function nth has 28 lines of code (exceeds 25 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 examples/helloworld/public/javascripts/prototype.js - About 1 hr to fix

                Function startDrag has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  startDrag: function(event) {
                    this.dragging = true;
                    if(!this.delta)
                      this.delta = this.currentDelta();
                
                
                Severity: Minor
                Found in examples/helloworld/public/javascripts/dragdrop.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

                Function updateElement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  updateElement: function(selectedElement) {
                    if (this.options.updateElement) {
                      this.options.updateElement(selectedElement);
                      return;
                    }
                Severity: Minor
                Found in examples/helloworld/public/javascripts/controls.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

                Function nth has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                      nth: function(fragment, m) {
                        var mm, formula = m[6], predicate;
                        if (formula == 'even') formula = '2n+0';
                        if (formula == 'odd')  formula = '2n+1';
                        if (mm = formula.match(/^(\d+)$/)) // digit only
                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

                Function scroll has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  scroll: function() {
                    var current = new Date();
                    var delta = current - this.lastScrolled;
                    this.lastScrolled = current;
                    if(this.options.scroll == window) {
                Severity: Minor
                Found in examples/helloworld/public/javascripts/dragdrop.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

                Function cumulativeOffset has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  Element.Methods.cumulativeOffset = function(element) {
                    var valueT = 0, valueL = 0;
                    do {
                      valueT += element.offsetTop  || 0;
                      valueL += element.offsetLeft || 0;
                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