autolab/Autolab

View on GitHub

Showing 419 of 572 total issues

Function plotTimeSeries has 59 lines of code (exceeds 25 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: Major
Found in app/assets/javascripts/tango_status.js - About 2 hrs to fix

    File scoreboards_controller.rb has 265 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class ScoreboardsController < ApplicationController
      before_action :set_assessment
      before_action :set_assessment_breadcrumb
      before_action :set_edit_assessment_breadcrumb, only: [:edit]
      before_action :set_scoreboard, except: [:create]
    Severity: Minor
    Found in app/controllers/scoreboards_controller.rb - About 2 hrs to fix

      File jobs_controller.rb has 264 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require "cgi"
      require "uri"
      require "tango_client"
      
      ##
      Severity: Minor
      Found in app/controllers/jobs_controller.rb - About 2 hrs to fix

        Function getDocument has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        PDFJS.getDocument = function getDocument(src,
                                                 pdfDataRangeTransport,
                                                 passwordCallback,
                                                 progressCallback) {
          var task = new PDFDocumentLoadingTask();
        Severity: Major
        Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

          Method request_access_token has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def request_access_token
              # get private key from JSON file to sign Autolab's client assertion as a JWK
              unless File.size?("#{Rails.configuration.config_location}/lti_tool_jwk.json")
                flash[:error] = "Autolab's JWK JSON file was not found"
                redirect_to([:users, @course]) && return
          Severity: Major
          Found in app/controllers/lti_nrps_controller.rb - About 2 hrs to fix

            File metricsgraphics_brushing.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function(root, factory) {
              if (typeof define === 'function' && define.amd) {
                define(['d3', 'jquery', 'MG'], factory);
              } else if (typeof exports === 'object') {
                module.exports = factory(require('d3'), require('jquery'), require('MG'));
            Severity: Minor
            Found in app/assets/javascripts/metricsgraphics_brushing.js - About 2 hrs to fix

              Function PDFObjectsClosure has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var PDFObjects = (function PDFObjectsClosure() {
                function PDFObjects() {
                  this.objs = {};
                }
              
              
              Severity: Major
              Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

                Function SVGGraphics_showText has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    showText: function SVGGraphics_showText(glyphs) {
                      var current = this.current;
                      var font = current.font;
                      var fontSize = current.fontSize;
                
                
                Severity: Major
                Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

                  Method log_submit has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def log_submit
                      @user = User.find_by(email: params[:user])
                      @cud = @user ? @course.course_user_data.find_by(user_id: @user.id) : nil
                      unless @cud
                        err = "ERROR: invalid username (#{params[:user]}) for class #{@course.id}"
                  Severity: Major
                  Found in app/controllers/assessment/handin.rb - About 2 hrs to fix

                    Method update_watchlist_configuration_for_course has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def self.update_watchlist_configuration_for_course(course_name, blocklist_update, allow_ca)
                        # Make sure the course exists
                        course = Course.find_by(name: course_name)
                        raise "Course #{course_name} cannot be found" if course.nil?
                    
                    
                    Severity: Minor
                    Found in app/models/watchlist_configuration.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

                    Method validateHandinForGroups has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def validateHandinForGroups
                        return :valid unless @assessment.has_groups?
                    
                        submitter_aud = @assessment.aud_for(@cud.id)
                        return :valid unless submitter_aud
                    Severity: Minor
                    Found in app/helpers/assessment_handin_core.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

                    Method parse_csv_row has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def parse_csv_row(row, kind, problems, emails)
                        row = row.dup
                    
                        email = row.shift.to_s
                        data = row.shift problems.count
                    Severity: Minor
                    Found in app/controllers/assessment/grading.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

                    Method index has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def index
                        path = params[:path].nil? ? "" : params[:path]
                        new_url = "#{path}/"
                        parts = new_url.split('/')
                        if parts.empty?
                    Severity: Minor
                    Found in app/controllers/file_manager_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 FontFaceObjectClosure has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var FontFaceObject = (function FontFaceObjectClosure() {
                      function FontFaceObject(name, file, properties) {
                        this.compiledGlyphs = {};
                        if (arguments.length === 1) {
                          // importing translated data
                    Severity: Major
                    Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

                      Function MessageHandler has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function MessageHandler(name, comObj) {
                        this.name = name;
                        this.comObj = comObj;
                        this.callbackIndex = 1;
                        this.postMessageTransfers = true;
                      Severity: Major
                      Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

                        Function StatTimerClosure has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var StatTimer = (function StatTimerClosure() {
                          function rpad(str, pad, length) {
                            while (str.length < length) {
                              str += pad;
                            }
                        Severity: Major
                        Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

                          Function CanvasGraphics_paintInlineImageXObject has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                function CanvasGraphics_paintInlineImageXObject(imgData) {
                                var width = imgData.width;
                                var height = imgData.height;
                                var ctx = this.ctx;
                          
                          
                          Severity: Major
                          Found in app/assets/javascripts/pdf.js - About 2 hrs to fix

                            Function setupColumnSort has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function setupColumnSort() {
                                  $headers.click(function (e) {
                                    // temporary workaround for a bug in jQuery 1.7.1 (http://bugs.jquery.com/ticket/11328)
                                    e.metaKey = e.metaKey || e.ctrlKey;
                            
                            Severity: Major
                            Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 2 hrs to fix

                              Function handleKeyDown has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function handleKeyDown(e) {
                                    trigger(self.onKeyDown, {row: activeRow, cell: activeCell}, e);
                                    var handled = e.isImmediatePropagationStopped();
                              
                                    if (!handled) {
                              Severity: Major
                              Found in app/assets/javascripts/SlickGrid/2.02/slick.grid.js - About 2 hrs to fix

                                Function set_tab_html has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function set_tab_html(is_search, instances, tab_name, archived_instances, empty_message, selected_user_ids) {
                                  is_empty = Object.keys(instances).length === 0;
                                  if (is_empty && !is_search){
                                    $(`#${tab_name}_header`).hide();
                                    html_empty_message = get_html_empty_message(empty_message);
                                Severity: Major
                                Found in app/assets/javascripts/watchlist.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language