autolab/Autolab

View on GitHub

Showing 419 of 572 total issues

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

  def tango_add_job(course, assessment, upload_file_list, callback_url, job_name, output_file)
Severity: Minor
Found in app/helpers/assessment_autograde_core.rb - About 45 mins to fix

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

      def validate_jwt_signature(id_token)
        # use JWK URL over file
        if !@lti_config_hash["platform_public_jwks_url"].nil? &&
           @lti_config_hash["platform_public_jwks_url"].present?
          # fetch JWKS from provided keys URL
    Severity: Minor
    Found in app/controllers/lti_launch_controller.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 set_search_action has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function set_search_action(instances, tab_name, archived_instances, empty_message, search_content, selected_user_ids) {
    Severity: Minor
    Found in app/assets/javascripts/watchlist.js - About 45 mins to fix

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

      function set_tab_html(is_search, instances, tab_name, archived_instances, empty_message, selected_user_ids) {
      Severity: Minor
      Found in app/assets/javascripts/watchlist.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
                                    character = shift_nums[character]; 
                                    if(character == k) kp++;
                                }
        Severity: Major
        Found in app/assets/javascripts/shortcut.js - About 45 mins to fix

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

          function search_enter_action(query, tab_name, instances, archived_instances, empty_message, selected_user_ids) {
          Severity: Minor
          Found in app/assets/javascripts/watchlist.js - About 45 mins to fix

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

            function showFiles() {
              var fileSelector = $("#handin_show_assessment input[type='file']").get(0);
              var file = fileSelector.files[0];
              $("#handin-file-name").text(file.name);
            
            
            Severity: Minor
            Found in app/assets/javascripts/handin.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 oidc_login has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def oidc_login
                unless File.size?("#{Rails.configuration.config_location}/lti_config.yml")
                  raise LtiError.new("LTI configuration not found on Autolab Server", :internal_server_error)
                end
            
            
            Severity: Minor
            Found in app/controllers/lti_launch_controller.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

            Avoid deeply nested control flow statements.
            Open

                        if ldapResult
                          @user.first_name = ldapResult[:first_name]
                          @user.last_name = ldapResult[:last_name]
                          @user.school = ldapResult[:school]
                          @user.major = ldapResult[:major]
            Severity: Major
            Found in app/controllers/users/omniauth_callbacks_controller.rb - About 45 mins to fix

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

                def authenticate_for_action
                  controller_whitelist = @@global_whitelist[params[:controller].to_sym]
                  return if controller_whitelist.nil?
              
                  level = controller_whitelist[params[:action].to_sym]
              Severity: Minor
              Found in app/controllers/application_controller.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

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

                def set_course
                  course_name = params[:course_name] ||
                                (params[:controller] == "courses" ? params[:name] : nil)
                  @course = Course.find_by(name: course_name) if course_name
              
              
              Severity: Minor
              Found in app/controllers/application_controller.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

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

                def self.get_nth_file(archive_path, n)
                  archive_type = get_archive_type(archive_path)
                  archive_extract = get_archive(archive_path, archive_type)
              
                  # Parse archive header
              Severity: Minor
              Found in lib/archive.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

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

                def update
                  if params[:group]
                    aud = @assessment.aud_for @cud.id
                    if @group.is_member(aud) || @cud.instructor
                      flash[:notice] = "Group was successfully updated." if @group.update(group_params)
              Severity: Minor
              Found in app/controllers/groups_controller.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

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

                def statistics
                  matrix = GradeMatrix.new @course, @cud
                  cols = {}
              
                  # extract assessment final scores
              Severity: Minor
              Found in app/controllers/gradebooks_controller.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

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

                def course_announcement(sender, to, subject, text, cud, course)
              Severity: Minor
              Found in app/mailers/course_mailer.rb - About 45 mins to fix

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

                    function defaultFormatter(row, cell, value, columnDef, dataContext) {
                Severity: Minor
                Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 35 mins to fix

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

                    function drawFigures(width, height, backgroundColor, figures, context) {
                  Severity: Minor
                  Found in app/assets/javascripts/pdf.js - About 35 mins to fix

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

                            function getMaxTextTemplate(texts, columnDef, colIndex, data, rowEl) {
                    Severity: Minor
                    Found in app/assets/javascripts/SlickGrid/2.02/plugins/slick.autocolumnsize.js - About 35 mins to fix

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

                          function appendCellHtml(stringArray, row, cell, colspan, item) {
                      Severity: Minor
                      Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 35 mins to fix

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

                        function showTopButtons(selectAllCheckbox, resolveButton, contactButton, deleteButton, exportButton) {
                        Severity: Minor
                        Found in app/assets/javascripts/watchlist.js - About 35 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language