concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

Avoid deeply nested control flow statements.
Open

        if (angle < 1e-6) {
          angle = 0;
        }
Severity: Major
Found in rails/app/assets/javascripts/flotr/excanvas.js - About 45 mins to fix

    Function drawSeriesPie has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        drawSeriesPie: function(series) {
            if (this.options.pie.drawn) return;
            
            var ctx = this.ctx,
                options = this.options,
    Severity: Minor
    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins 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 getTokenBounds has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      getTokenBounds: function() {
        if (null != this.tokenBounds) return this.tokenBounds;
        var value = this.element.value;
        if (value.strip().empty()) return [-1, 0];
        var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
    Severity: Minor
    Found in rails/app/assets/javascripts/controls.js - About 45 mins 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 plotCandlesShadows has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        plotCandlesShadows: function(series, offset){
            var data = series.data;
            if(data.length < 1 || series.candles.barcharts) return;
            
            var xa = series.xaxis,
    Severity: Minor
    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins 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 drawHit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        drawHit: function(n){
            var octx = this.octx,
                s = n.series,
                tHoz = this.tHoz.bind(this),
                tVert = this.tVert.bind(this);
    Severity: Minor
    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                            for (j = 0; j < s.data.length; j++) {
                                if (s.bars.show && s.bars.stacked) {
                                    var x = s.data[j][0]+'';
                                    stackedSums[x] = (stackedSums[x] || 0) + s.data[j][1];
                                    lastSerie = s;
    Severity: Major
    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins to fix

      Function transform has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
      Severity: Minor
      Found in rails/app/assets/javascripts/flotr/excanvas.js - About 45 mins to fix

        Function RGBtoHSB has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        Rico.Color.RGBtoHSB = function(red, green, blue) {
                var hue, saturation, brightness;
                var max = Math.max(red, green, blue), min = Math.min(red, green, blue);
                var delta = max - min;
                brightness = max / 255;
        Severity: Minor
        Found in rails/app/assets/javascripts/active_scaffold/default/rico_corner.js - About 45 mins 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 setTransform has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
        Severity: Minor
        Found in rails/app/assets/javascripts/flotr/excanvas.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (!b.horizontal && (b.barWidth + axis.datamax > newmax))
                                      newmax = axis.max + (b.centered ? b.barWidth/2 : b.barWidth);
          Severity: Major
          Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if(!tick.label || tick.label.length == 0 || 
                                    (this.plotOffset.left + this.tHoz(tick.v, axis) < 0) || 
                                    (this.plotOffset.left + this.tHoz(tick.v, axis) > this.canvasWidth)) continue;
            Severity: Major
            Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins to fix

              Function createRadialGradient has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
                                                                 aX1, aY1, aR1) {
              Severity: Minor
              Found in rails/app/assets/javascripts/flotr/excanvas.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                        if (angle < 0) {
                          angle += 360;
                        }
                Severity: Major
                Found in rails/app/assets/javascripts/flotr/excanvas.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                            for(j = 1; j < data[h].length; j++){
                                                y = data[h][j];
                                                 if(y < yaxis.datamin) yaxis.datamin = y;
                                              else if(y > yaxis.datamax) yaxis.datamax = y;
                                            }
                  Severity: Major
                  Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins to fix

                    Function setSelectionPos has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        setSelectionPos: function(pos, event) {
                            var options = this.options,
                                offset = $(this.overlay).cumulativeOffset();
                            
                            if(options.selection.mode.indexOf('x') == -1){
                    Severity: Minor
                    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins 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 drawHit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        drawHit: function(n){
                            var octx = this.octx,
                                s = n.series,
                                tHoz = this.tHoz.bind(this),
                                tVert = this.tVert.bind(this);
                    Severity: Minor
                    Found in rails/app/assets/javascripts/flotr/flotr.js - About 45 mins 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

                    Avoid deeply nested control flow statements.
                    Open

                                                if ( !xhrCallbacks ) {
                                                    xhrCallbacks = {};
                                                    jQuery( window ).unload( xhrOnUnloadAbort );
                                                }
                    Severity: Major
                    Found in rails/app/assets/javascripts/jquery/jquery.js - About 45 mins to fix

                      Function createControl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        createControl: function(mode, handler, extraClasses) {
                          var control = this.options[mode + 'Control'];
                          var text = this.options[mode + 'Text'];
                          if ('button' == control) {
                            var btn = document.createElement('input');
                      Severity: Minor
                      Found in rails/app/assets/javascripts/controls.js - About 45 mins 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 bezierCurveTo has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
                                                                  aCP2x, aCP2y,
                                                                  aX, aY) {
                      Severity: Minor
                      Found in rails/app/assets/javascripts/flotr/excanvas.js - About 45 mins to fix

                        Function open has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          open: function() {
                            if (this.is_disabled()) return;
                        
                            if (this.tag.hasAttribute( "dhtml_confirm")) {
                              if (this.onclick) this.onclick();
                        Severity: Minor
                        Found in rails/app/assets/javascripts/active_scaffold/default/active_scaffold.js - About 45 mins 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