autolab/Autolab

View on GitHub

Showing 419 of 572 total issues

Function pdfDataRangeTransportClosure has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var PDFDataRangeTransport = (function pdfDataRangeTransportClosure() {
  /**
   * @constructs PDFDataRangeTransport
   * @param {number} length
   * @param {Uint8Array} initialData
Severity: Major
Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

    Method scoreboardOrderSubmissions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

      def scoreboardOrderSubmissions(a, b)
        # If the assessment is not autograded, or the instructor did
        # not create a custom column spec, then revert to the default,
        # which sorts by total problem, then by submission time.
        if !@assessment.has_autograder? ||
    Severity: Minor
    Found in app/controllers/scoreboards_controller.rb - About 2 hrs 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 CanvasGraphics_showType3Text has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        showType3Text: function CanvasGraphics_showType3Text(glyphs) {
          // Type3 fonts - each glyph is a "mini-PDF"
          var ctx = this.ctx;
          var current = this.current;
          var font = current.font;
    Severity: Major
    Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

      Function PageViewport has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) {
          this.viewBox = viewBox;
          this.scale = scale;
          this.rotation = rotation;
          this.offsetX = offsetX;
      Severity: Major
      Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

        Function PDFDocumentProxyClosure has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
          function PDFDocumentProxy(pdfInfo, transport) {
            this.pdfInfo = pdfInfo;
            this.transport = transport;
          }
        Severity: Major
        Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

          Method submit has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def submit
              if @assessment.embedded_quiz
                raise ApiError.new("Assessment is an embedded quiz", :bad_request)
              end
          
          
          Severity: Major
          Found in app/controllers/api/v1/assessments_controller.rb - About 2 hrs to fix

            Method stats_for_grader has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def stats_for_grader(submissions)
                result = []
                problem_id_to_name = @assessment.problem_id_to_name
                stats = Statistics.new
            
            
            Severity: Minor
            Found in app/controllers/assessment/grading.rb - About 1 hr to fix

              Function showMenu has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function showMenu(e) {
                          var $menuButton = $(this);
                          var menu = $menuButton.data("menu");
                          var columnDef = $menuButton.data("column");
              
              
              Severity: Minor
              Found in app/assets/javascripts/SlickGrid/2.02/plugins/slick.headermenu.js - About 1 hr to fix

                Function createMeshCanvas has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function createMeshCanvas(bounds, combinesScale, coords, colors, figures,
                                            backgroundColor) {
                    // we will increase scale on some weird factor to let antialiasing take
                    // care of "rough" edges
                    var EXPECTED_SCALE = 1.1;
                Severity: Minor
                Found in app/assets/javascripts/pdf.js - About 1 hr to fix

                  Method update_latest has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def update_latest
                      require_params([:problems])
                  
                      cud = get_cud params
                      aud = AssessmentUserDatum.find_by(assessment_id: @assessment.id, course_user_datum_id: cud.id)
                  Severity: Minor
                  Found in app/controllers/api/v1/scores_controller.rb - About 1 hr to fix

                    Method deserialize has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def deserialize(s)
                        unless s["general"]
                          raise "General section missing in yaml"
                        end
                    
                    
                    Severity: Minor
                    Found in app/models/assessment.rb - About 1 hr 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 quickSetScore has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def quickSetScore
                        return unless request.post?
                        return unless params[:submission_id]
                        return unless params[:problem_id]
                    
                    
                    Severity: Minor
                    Found in app/controllers/assessment/grading.rb - About 1 hr 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 add has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def add
                        if !@assessment.allow_student_assign_group && @cud.student?
                          flash[:error] = "You are not allowed to add members to your group for this assessment. "\
                            "Contact your instructor for group assignment."
                          redirect_to(action: :index) && return
                    Severity: Minor
                    Found in app/controllers/groups_controller.rb - About 1 hr 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 quickSetScoreDetails has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def quickSetScoreDetails
                        return unless request.post?
                        return unless params[:submission_id]
                        return unless params[:problem_id]
                         # get submission and problem IDs
                    Severity: Minor
                    Found in app/controllers/assessment/grading.rb - About 1 hr 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 has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def bulkGrade
                        return unless request.post?
                    
                        # part 1: submitting a CSV for processing and returning errors in CSV
                        if params[:upload]
                    Severity: Minor
                    Found in app/controllers/assessment/grading.rb - About 1 hr 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 CanvasGraphics_paintChar has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        paintChar: function CanvasGraphics_paintChar(character, x, y) {
                          var ctx = this.ctx;
                          var current = this.current;
                          var font = current.font;
                          var textRenderingMode = current.textRenderingMode;
                    Severity: Minor
                    Found in app/assets/javascripts/pdf.js - About 1 hr to fix

                      Method extend_config_module has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def extend_config_module(assessment, submission, cud)
                          # autograde core calls might be called before migration to unique module name occurs, so need to add check
                          begin
                            if @assessment.use_unique_module_name
                              require assessment.unique_config_file_path
                      Severity: Minor
                      Found in app/helpers/assessment_autograde_core.rb - About 1 hr to fix

                        Function updateRowCount has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function updateRowCount() {
                              var dataLength = getDataLength();
                              if (!initialized) { return; }
                              numberOfRows = getDataLengthIncludingAddNew() +
                                  (options.leaveSpaceForNewRows ? numVisibleRows - 1 : 0);
                        Severity: Minor
                        Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 1 hr to fix

                          Function CanvasGraphics_executeOperatorList has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              executeOperatorList: function CanvasGraphics_executeOperatorList(
                                                              operatorList,
                                                              executionStartIdx, continueCallback,
                                                              stepper) {
                                var argsArray = operatorList.argsArray;
                          Severity: Minor
                          Found in app/assets/javascripts/pdf.js - About 1 hr to fix

                            Function hijack has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                hijack: function( event, type, dd, x, elem ){
                                    // not configured
                                    if ( !dd ) 
                                        return;
                                    // remember the original event and type
                            Severity: Minor
                            Found in app/assets/javascripts/jquery.event.drag-2.2.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language