Showing 35 of 60 total issues

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

      Tour.prototype._reposition = function(tip, step) {
        var offsetBottom, offsetRight, original_left, original_offsetHeight, original_offsetWidth, original_top, tipOffset;
        original_offsetWidth = tip[0].offsetWidth;
        original_offsetHeight = tip[0].offsetHeight;
        tipOffset = tip.offset();
Severity: Minor
Found in app/assets/javascripts/plugins/bootstrap-tour.js - About 1 hr to fix

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

      Backlog.prototype.refresh = function(updateHistory, data) {
        var _this = this;
    
        var sorting = Sorting.instances[0];
        var filter = Filter.instances[0];
    Severity: Minor
    Found in app/assets/javascripts/cells/backlog.js - About 1 hr to fix

      Function html has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              html: function (ctl) {
                  
                  var re_nl = null;
                  var st = ctl.val();
                  
      Severity: Minor
      Found in app/assets/javascripts/plugins/jtextarea.js - About 1 hr to fix

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

          Labels.prototype.attachEvents = function() {
            var _this = this;
        
            var options = {
              success: function(responseText, status, xhr) {
        Severity: Minor
        Found in app/assets/javascripts/cells/labels.js - About 1 hr to fix

          Function initialize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              initialize: function() {
                $(".backlog-sortable").sortable({
                  connectWith: ".backlog-connected",
                  placeholder: "backlog-placeholder-element",
                  update: function(event, ui) {
          Severity: Minor
          Found in app/assets/javascripts/sprint_ordering.js - About 1 hr to fix

            Function toUpdateForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              GridDialog.prototype.toUpdateForm = function(event) {
                if ($(event.target).is(".destroy")) return;
            
                var _this = this;
            
            
            Severity: Minor
            Found in app/assets/javascripts/widgets/patterns/grid_dialog.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                              for (j=0; j < files.length; j++) {
                                  a.push({name: n, value: files[j], type: el.type});
                              }
              Severity: Major
              Found in app/assets/javascripts/plugins/jquery.form.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if (elements) 
                                elements.push(el);
                Severity: Major
                Found in app/assets/javascripts/plugins/jquery.form.js - About 45 mins to fix

                  Method apply_filter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def apply_filter(reflection)
                          return reflection unless params[:filter]
                  
                          persist_filter_information!
                  
                  
                  Severity: Minor
                  Found in lib/extensions/action_controller/filter.rb - About 35 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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def process(text, project)
                        text.gsub! PROJECT_WIDE_MATCHER do |match|
                          key = $1
                          number = $2
                  
                  
                  Severity: Minor
                  Found in lib/markdown_preprocessors/issue_auto_link.rb - About 35 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 too many return statements within this function.
                  Open

                      return this;
                  Severity: Major
                  Found in app/assets/javascripts/plugins/jquery.form.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return $(el).val();
                    Severity: Major
                    Found in app/assets/javascripts/plugins/jquery.form.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              return;
                      Severity: Major
                      Found in app/assets/javascripts/plugins/jquery.form.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return this;
                        Severity: Major
                        Found in app/assets/javascripts/plugins/jquery.form.js - About 30 mins to fix

                          Method issue_priority has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def issue_priority(issue, short = false)
                              return unless issue.issue_priority
                          
                              name = if short
                                       issue.issue_priority.name[0].upcase
                          Severity: Minor
                          Found in app/helpers/issues_helper.rb - About 25 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