autolab/Autolab

View on GitHub

Showing 419 of 572 total issues

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

    function gotoNext(row, cell, posX) {
      if (row == null && cell == null) {
        row = cell = posX = 0;
        if (canCellBeActive(row, cell)) {
          return {
Severity: Minor
Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 1 hr to fix

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

        function updateColumnHeader(columnId, title, toolTip) {
          if (!initialized) { return; }
          var idx = getColumnIndex(columnId);
          if (idx == null) {
            return;
    Severity: Minor
    Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 1 hr to fix

      Method sendJob has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def sendJob(course, assessment, submissions, cud)
          extend_config_module(assessment, submissions[0], cud)
      
          # Get the autograding properties for this assessment.
          @autograde_prop = assessment.autograder
      Severity: Minor
      Found in app/helpers/assessment_autograde_core.rb - About 1 hr to fix

        Method create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def create
            @attachment = if @is_assessment
                            @course.attachments.new(assessment_id: @assessment.id)
                          else
                            @course.attachments.new
        Severity: Minor
        Found in app/controllers/attachments_controller.rb - About 1 hr to fix

          Function drawTriangle has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {
          Severity: Major
          Found in app/assets/javascripts/pdf.js - About 1 hr to fix

            Method csv_header has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def csv_header(matrix, course)
                header = %w(Email first_name last_name Lecture Section School Major Year grace_days_used penalty_late_days)
                course.assessment_categories.each do |cat|
                  next unless matrix.has_category? cat
            
            
            Severity: Minor
            Found in app/helpers/gradebook_helper.rb - About 55 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 get_public_key has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def get_public_key(platform_public_key_file, platform_public_jwks)
                # import public key depending on whether we have a JSON file
                # with a single JWK or list of JWKs
                if !platform_public_key_file.nil?
                  begin
            Severity: Minor
            Found in app/controllers/lti_launch_controller.rb - About 55 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 gradesheet_csv has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def gradesheet_csv(asmt, as_seen_by)
                CSV.generate do |csv|
                  # title row with the column names:
                  title = ["Submission Time","Email","Total"]
                  asmt.problems.each { |problem| title << problem.name }
            Severity: Minor
            Found in app/helpers/assessment_helper.rb - About 55 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 plotTimeSeries has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            var plotTimeSeries = function(data) {
              // Initialize Dataset
              var new_jobs = data[0];
              var eventarr = [];
              for (var i = 0; i < new_jobs.dates.length; i++) {
            Severity: Minor
            Found in app/assets/javascripts/tango_status.js - About 55 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 gradebook_columns has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def gradebook_columns(matrix, course)
                # user info columns
                columns = [
                  { id: "number", name: "#", field: "", width: 50 },
                  { id: "email", name: "Email", field: "email",
            Severity: Minor
            Found in app/helpers/gradebook_helper.rb - About 55 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 applied_value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.applied_value(adj, score, multiplier)
                raise ArgumentError, "ScoreAdjustment.applied_value: score was nil" if score.nil?
            
                if adj.nil?
                  0.0
            Severity: Minor
            Found in app/models/score_adjustment.rb - About 55 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 tango_poll has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def tango_poll(course, assessment, submissions, output_file)
                feedback = nil
                begin
                  Timeout.timeout(80) do
                    loop do
            Severity: Minor
            Found in app/helpers/assessment_autograde_core.rb - About 55 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 matrix! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def matrix!
                cell_by_asmt = {}
                cat_avg_by_cat = {}
                course_avg_by_user = {}
            
            
            Severity: Minor
            Found in app/models/grade_matrix.rb - About 55 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 submit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def submit
                if @assessment.embedded_quiz
                  raise ApiError.new("Assessment is an embedded quiz", :bad_request)
                end
            
            
            Severity: Minor
            Found in app/controllers/api/v1/assessments_controller.rb - About 55 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 download_tar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def download_tar
                path = params[:path]&.split("/")&.drop(2)&.join("/")
                path = CGI.unescape(path)
                absolute_path = check_path_exist(path)
                return unless check_instructor(absolute_path)
            Severity: Minor
            Found in app/controllers/file_manager_controller.rb - About 55 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 bulkGrade_complete has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def bulkGrade_complete
                redirect_to(action: :bulkGrade) && return unless request.post?
            
                # retrieve entries CSV from hidden field in form
                csv = params[:confirm][:bulkGrade_csv]
            Severity: Minor
            Found in app/controllers/assessment/grading.rb - About 55 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 handle_exceptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.handle_exceptions
                begin
                  retries_remaining ||= NUM_RETRIES
                  resp = yield
                rescue Net::OpenTimeout, Net::ReadTimeout, Timeout::Error,
            Severity: Minor
            Found in lib/tango_client.rb - About 55 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 clipBbox has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) {
            Severity: Minor
            Found in app/assets/javascripts/pdf.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                    if (x && c.maxWidth && (c.maxWidth - c.previousWidth < x)) {
                                      x -= c.maxWidth - c.previousWidth;
                                      c.width = c.maxWidth;
                                    } else {
                                      c.width = c.previousWidth + x;
              Severity: Major
              Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 45 mins to fix

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

                    setCharWidthAndBounds: function CanvasGraphics_setCharWidthAndBounds(xWidth,
                                                                                        yWidth,
                                                                                        llx,
                                                                                        lly,
                                                                                        urx,
                Severity: Minor
                Found in app/assets/javascripts/pdf.js - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language