expertiza/expertiza

View on GitHub

Showing 431 of 4,497 total issues

Class AssignmentForm has 33 methods (exceeds 20 allowed). Consider refactoring.
Open

class AssignmentForm
  attr_accessor :assignment,
                :assignment_questionnaires,
                :due_dates,
                :tag_prompt_deployments,
Severity: Minor
Found in app/models/assignment_form.rb - About 4 hrs to fix

    File quiz_questionnaires_controller_spec.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    describe QuizQuestionnairesController do
      let(:questionnaire) do
        build(id: 1, name: 'questionnaire', ta_id: 8, course_id: 1, private: false, min_question_score: 0, max_question_score: 5, type: 'ReviewQuestionnaire')
      end
      let(:questionnaire) { build(:questionnaire) }
    Severity: Minor
    Found in spec/controllers/quiz_questionnaires_controller_spec.rb - About 4 hrs to fix

      Method update_assignment_questionnaires has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

        def update_assignment_questionnaires(attributes)
          return if attributes.nil? || attributes.empty?
      
          if attributes[0].key?(:questionnaire_weight)
            validate_assignment_questionnaires_weights(attributes)
      Severity: Minor
      Found in app/models/assignment_form.rb - About 4 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 render has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render: function() {
            var creation_date
            var updated_date
            var colWidthArray = [ '30%', '0%', '0%', '0%', '25%', '25%', '20%' ]
            var colDisplayStyle = {
      Severity: Major
      Found in app/assets/javascripts/tree_display.jsx - About 4 hrs to fix

        Class User has 32 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class User < ApplicationRecord
          enum locale: Locale.code_name_to_db_encoding(Locale.available_locale_preferences)
          acts_as_authentic do |config|
            config.validates_uniqueness_of_email_field_options = { if: -> { false } } # Don't validate email uniqueness
            config.crypto_provider = Authlogic::CryptoProviders::Sha1
        Severity: Minor
        Found in app/models/user.rb - About 4 hrs to fix

          Class SignUpSheetController has 32 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class SignUpSheetController < ApplicationController
            include AuthorizationHelper
          
            require 'rgl/adjacency'
            require 'rgl/dot'
          Severity: Minor
          Found in app/controllers/sign_up_sheet_controller.rb - About 4 hrs to fix

            Function RenderCal has 98 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function RenderCal()
            {
                var vCalHeader;
                var vCalData;
                var vCalTime;
            Severity: Major
            Found in app/assets/javascripts/datetimepicker.js - About 3 hrs to fix

              File response_spec.rb has 329 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              describe Response do
                let(:user) { build(:student, id: 1, role_id: 1, name: 'no name', fullname: 'no one') }
                let(:user2) { build(:student, id: 2, role_id: 2, name: 'no name2', fullname: 'no one2') }
                let(:participant) { build(:participant, id: 1, parent_id: 1, user: user) }
                let(:participant2) { build(:participant, id: 2, parent_id: 2, user: user2) }
              Severity: Minor
              Found in spec/models/response_spec.rb - About 3 hrs to fix

                File submitted_content_controller_spec.rb has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                describe SubmittedContentController do
                  let(:admin) { build(:admin, id: 3) }
                  let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
                  let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
                  let(:student1) { build(:student, id: 21, role_id: 1) }
                Severity: Minor
                Found in spec/controllers/submitted_content_controller_spec.rb - About 3 hrs to fix

                  File course_analytic_spec.rb has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class CourseAnalyticTestDummyClass
                    attr_accessor :course, :participants, :assignments
                    require 'analytic/course_analytic'
                    include CourseAnalytic
                  
                  
                  Severity: Minor
                  Found in spec/models/course_analytic_spec.rb - About 3 hrs to fix

                    File response_controller.rb has 316 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    class ResponseController < ApplicationController
                      include AuthorizationHelper
                      include ResponseHelper
                    
                      helper :submitted_content
                    Severity: Minor
                    Found in app/controllers/response_controller.rb - About 3 hrs to fix

                      Method assignment_questionnaire has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def assignment_questionnaire(questionnaire_type, round_number, topic_id, duty_id = nil)
                          round_number = nil if round_number.blank?
                          topic_id = nil if topic_id.blank?
                      
                          # Default value of duty_id is nil, and when duty_id is not nil, then it means that the function call
                      Severity: Minor
                      Found in app/models/assignment_form.rb - About 3 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

                      File student_task_spec.rb has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      describe StudentTask do
                        # Write your mocked object here!
                        let(:participant) { build(:participant, id: 1, user_id: user.id, parent_id: assignment.id) }
                        let(:participant2) { build(:participant, id: 2, user_id: user2.id, parent_id: assignment.id) }
                        let(:user) { create(:student) }
                      Severity: Minor
                      Found in spec/models/student_task_spec.rb - About 3 hrs to fix

                        Function NewCal has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function NewCal(pCtrl,pFormat,pShowTime,pTimeMode)
                        {
                            Cal=new Calendar(dtToday);
                            if ((pShowTime!=null) && (pShowTime))
                            {
                        Severity: Minor
                        Found in app/assets/javascripts/datetimepicker.js - About 3 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 course_student_grade_summary has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def course_student_grade_summary
                            @topics = {}
                            @assignment_grades = {}
                            @peer_review_scores = {}
                            @final_grades = {}
                        Severity: Minor
                        Found in app/controllers/assessment360_controller.rb - About 3 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 render has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            render: function() {
                              var creation_date
                              var updated_date
                              var colWidthArray = [ '30%', '0%', '0%', '0%', '25%', '25%', '20%' ]
                              var colDisplayStyle = {
                        Severity: Major
                        Found in app/assets/javascripts/tree_display.jsx - About 3 hrs to fix

                          File view_team_in_grades.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          $ = jQuery;
                          
                          $(function () {
                              // Changed as part of E1788_OSS_project_Maroon_Heatmap_fixes
                              // scoreTable was assigned as classes for the table which is required to be sortable
                          Severity: Minor
                          Found in app/assets/javascripts/view_team_in_grades.js - About 3 hrs to fix

                            Class ReviewMappingController has 27 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class ReviewMappingController < ApplicationController
                              include AuthorizationHelper
                            
                              autocomplete :user, :name
                              # helper :dynamic_review_assignment
                            Severity: Minor
                            Found in app/controllers/review_mapping_controller.rb - About 3 hrs to fix

                              File grades_controller_spec.rb has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              describe GradesController do
                                let(:review_response) { build(:response) }
                                let(:assignment) { build(:assignment, id: 1, max_team_size: 2, questionnaires: [review_questionnaire], is_penalty_calculated: true) }
                                let(:assignment2) { build(:assignment, id: 2, max_team_size: 2, questionnaires: [review_questionnaire], is_penalty_calculated: true) }
                                let(:assignment3) { build(:assignment, id: 3, max_team_size: 0, questionnaires: [review_questionnaire], is_penalty_calculated: true) }
                              Severity: Minor
                              Found in spec/controllers/grades_controller_spec.rb - About 3 hrs to fix

                                Function render has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    render: function() {
                                      var moreContent = []
                                      var moreButtonStyle = {
                                        display: '',
                                        padding: '0 2px'
                                Severity: Major
                                Found in app/assets/javascripts/tree_display.jsx - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language