concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

    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

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

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

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

              Avoid deeply nested control flow statements.
              Open

                                        if(options.legend.backgroundOpacity != 0.0){
                                            /**
                                             * Put in the transparent background separately to avoid blended labels and
                                             * label boxes.
                                             */
              Severity: Major
              Found in rails/app/assets/javascripts/flotr/flotr.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if (searchText.length) {
                                startpos = option.search_text.search(zregex);
                                text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
                                option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
                              }
                Severity: Major
                Found in rails/app/assets/javascripts/chosen.proto.js - About 45 mins to fix

                  Method perform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def perform
                      if import.import_type == Import::Import::IMPORT_TYPE_ACTIVITY
                        import_activity(data_json,import)
                      else
                        import.total_imports = data_json.size
                  Severity: Minor
                  Found in rails/app/models/import/import_external_activity.rb - 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 show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    show: function(point, element) {
                      if(!this.drops.length) return;
                      var drop, affected = [];
                  
                      this.drops.each( function(drop) {
                  Severity: Minor
                  Found in rails/app/assets/javascripts/dragdrop.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      initialize: function(tab_list_container,options){
                          if(!$(tab_list_container))
                              throw "Control.Tabs could not find the element: " + tab_list_container;
                          this.activeContainer = false;
                          this.activeLink = false;
                  Severity: Minor
                  Found in rails/app/assets/javascripts/livepipe/tabs.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

                              } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
                                option.search_match = true;
                              }
                  Severity: Major
                  Found in rails/app/assets/javascripts/chosen.proto.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  if (results_group != null) {
                                    results_group.group_match = true;
                                  }
                    Severity: Major
                    Found in rails/app/assets/javascripts/chosen.proto.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (!(res.current = 1 + tok.indexOf("c"))) {
                                                              res.current = (1 + res.blockwide) >> 1;
                                                          }
                      Severity: Major
                      Found in rails/app/assets/javascripts/jquery.paging.js - About 45 mins to fix

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

                          _tree: function(element, options, parent) {
                            var children = Sortable.findElements(element, options) || [];
                        
                            for (var i = 0; i < children.length; ++i) {
                              var match = children[i].id.match(options.format);
                        Severity: Minor
                        Found in rails/app/assets/javascripts/dragdrop.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

                        Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def initialize(offering, protocol, host_with_port, current_user, additional_external_report_id, anonymize_students = false)
                        Severity: Minor
                        Found in rails/app/models/api/v1/offering.rb - About 45 mins to fix

                          Function create has a Cognitive Complexity of 8 (exceeds 5 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: Minor
                          Found in rails/app/assets/javascripts/dragdrop.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 (! selected.empty())
                                        this.selectedList = this.selectedList.findAll(function(entry) {return !selected.include(entry.value)});
                          Severity: Major
                          Found in rails/app/assets/javascripts/prototype-ui/prototype-ui.js - About 45 mins to fix

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

                              loop: function(timePos) {
                                if (timePos >= this.startOn) {
                                  if (timePos >= this.finishOn) {
                                    this.render(1.0);
                                    this.cancel();
                            Severity: Minor
                            Found in rails/app/assets/javascripts/effects.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