concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

  contextPrototype.arc = function(aX, aY, aRadius,
                                  aStartAngle, aEndAngle, aClockwise) {
Severity: Minor
Found in rails/app/assets/javascripts/flotr/excanvas.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (tick) label = tick[1];
    Severity: Major
    Found in rails/app/assets/javascripts/flotr/flotr_out.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.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(!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.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (!tick.label || tick.label.length == 0 ||
                                     (this.plotOffset.top + this.tVert(tick.v, axis) < 0) || 
                                     (this.plotOffset.top + this.tVert(tick.v, axis) > this.canvasHeight)) continue;
        Severity: Major
        Found in rails/app/assets/javascripts/flotr/flotr.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.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 (var j in stackedSums) {
                                      newmax = Math.max(stackedSums[j], newmax);
                                  }
          Severity: Major
          Found in rails/app/assets/javascripts/flotr/flotr.js - About 45 mins to fix

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

              focus: function(event, element) {
                if (event)
                  event.stop();
            
                // Multi selection with shift
            Severity: Minor
            Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.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(b.stacked && b.horizontal){
                                        for (j = 0; j < s.data.length; j++) {
                                            if (b.show && b.stacked) {
                                                var x = s.data[j][0]+'';
                                                stackedSums[x] = (stackedSums[x] || 0) + s.data[j][1];
            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.top + this.tVert(tick.v, axis) < 0) || 
                                           (this.plotOffset.top + this.tVert(tick.v, axis) > this.canvasHeight)) continue;
              Severity: Major
              Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 45 mins to fix

                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.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for (var j in stackedSums) {
                                              newmax = Math.max(stackedSums[j], newmax);
                                          }
                  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.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                     if(p.charAt(1) == 'e') pos += 'right:' + (m + plotOffset.right) + 'px;';
                                                else if(p.charAt(1) == 'w') pos += 'left:' + (m + plotOffset.left) + 'px;';
                      Severity: Major
                      Found in rails/app/assets/javascripts/flotr/flotr.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if (tick) label = tick[1];
                        Severity: Major
                        Found in rails/app/assets/javascripts/flotr/flotr.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                     if(x < xaxis.datamin) xaxis.datamin = x;
                                                     else if(x > xaxis.datamax) xaxis.datamax = x;
                          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(p.charAt(1) == 'e') pos += 'right:' + (m + plotOffset.right) + 'px;';
                                                      else if(p.charAt(1) == 'w') pos += 'left:' + (m + plotOffset.left) + 'px;';
                            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.top + this.tVert(tick.v, axis) < 0) || 
                                                           (this.plotOffset.top + this.tVert(tick.v, axis) > this.canvasHeight)) continue;
                              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(p.charAt(0) == 'n') pos += 'top:' + (m + plotOffset.top) + 'px;';
                                                          else if(p.charAt(0) == 's') pos += 'bottom:' + (m + plotOffset.bottom) + 'px;';                    
                                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 (!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.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language