sleepepi/sleepportal

View on GitHub

Showing 332 of 436 total issues

Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        init: function (el, values, options, width, height) {
Severity: Minor
Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

    Function drawNormalRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            drawNormalRange: function (canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey) {
    Severity: Minor
    Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

      Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              init: function (el, values, options, width, height) {
      Severity: Minor
      Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

          def file_type_count(current_user, file_type)
            source_files = {}
            selected_report_concepts = []
            Variable.current.with_source(self.sources.collect{|s| s.id}).where( variable_type: 'file' ).each do |variable|
              selected_report_concepts << ReportConcept.new( variable_id: variable.id )
        Severity: Minor
        Found in app/models/search.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

        Function map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          Array.prototype.map = function(fun /*, thisp*/)
          {
            var len = this.length;
            if (typeof fun != "function")
              throw new TypeError();
        Severity: Minor
        Found in app/assets/javascripts/compatibility/prototype_map.js - 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 set_searches has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def set_searches
              @cases = current_user.all_searches.find_by_id(params[:cases_id])
              @controls = current_user.all_searches.find_by_id(params[:controls_id])
              @controls_per_case = (params[:controls_per_case].to_i <= 4 and params[:controls_per_case].to_i >= 1) ? params[:controls_per_case].to_i : 1
              @sources = (@cases ? @cases.sources.to_a : []) & (@controls ? @controls.sources.to_a : [])
        Severity: Minor
        Found in app/controllers/matching_controller.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 table_columns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          def table_columns(current_user, table, page = 1, per_page = -1, filter_unmapped = false, search = '')
            result_hash = Aqueduct::Builder.wrapper(self, current_user).table_columns(table)
        
            columns = result_hash[:columns]
            error = result_hash[:error]
        Severity: Minor
        Found in app/models/source.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;
        Severity: Major
        Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return false;
          Severity: Major
          Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return;
            Severity: Major
            Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this function.
                Open

                                        return (this.opts.element.outerWidth() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px');
                Severity: Major
                Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return;
                  Severity: Major
                  Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            if (b.constructor === String) return b.localeCompare(a) === 0;
                    Severity: Major
                    Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return -1;
                      Severity: Major
                      Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                            return null;
                        Severity: Major
                        Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return this.opts.width;
                          Severity: Major
                          Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                return this.opts.width();
                            Severity: Major
                            Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                          return;
                              Severity: Major
                              Found in app/assets/javascripts/external/select2.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                        return;
                                Severity: Major
                                Found in app/assets/javascripts/external/select2.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language