ece517-p3/expertiza

View on GitHub

Showing 2,813 of 2,813 total issues

Assignment Branch Condition size for notify_grade_conflict_message is too high. [18.97/15]
Open

  def notify_grade_conflict_message(defn)
    @body = defn[:body]

    @assignment = @body[:assignment]
    @reviewer_name = @body[:reviewer_name]
Severity: Minor
Found in app/mailers/mailer.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Consider simplifying this complex logical expression.
Open

              if (((entry.name && entry.name.indexOf(_this.props.filterText) !== -1) ||
                  (entry.creation_date && entry.creation_date.indexOf(_this.props.filterText) !== -1) ||
                  (entry.institution && entry.institution.indexOf(_this.props.filterText) !== -1) ||
                  (entry.updated_date && entry.updated_date.indexOf(_this.props.filterText) !== -1)) &&
                  (entry.private == true || entry.type == 'FolderNode')) {
Severity: Critical
Found in app/assets/javascripts/tree_display.jsx - About 2 hrs to fix

    Method list has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def list
        @automated_metareview = AutomatedMetareview.new
        # pass in the response id as a parameter
        @response = Response.find_by(map_id: params[:id])
        @automated_metareview.calculate_metareview_metrics(@response, params[:id])
    Severity: Minor
    Found in app/controllers/automated_metareviews_controller.rb - About 2 hrs to fix

      Block has too many lines. [45/25]
      Open

      describe SignUpSheet do
        describe '.add_signup_topic' do
          it 'will return an empty Hash when there are no topics' do
            assignment = double('Assignment')
            allow(assignment).to receive(:num_review_rounds) { nil }
      Severity: Minor
      Found in spec/models/sign_up_sheet_spec.rb by rubocop

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

      Block has too many lines. [45/25]
      Open

      describe LotteryController do
        describe "#run_intelligent_assignmnent" do
          it "webservice call should be successful" do
            dat = double("data")
            rest = double("RestClient")

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

      Block has too many lines. [45/25]
      Open

      describe "Integration tests for instructor interface" do
        before(:each) do
          assignment_setup
        end
      
      

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

      Function col_sort has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function col_sort(m) {
          lesser = !lesser
          // Swaps two columns of the table
          jQuery.moveColumn = function (table, from, to) {
              var rows = jQuery('tr', table);
      Severity: Minor
      Found in app/assets/javascripts/view_team_in_grades.js - About 1 hr to fix

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

          def scores(questions)
            scores = {}
            scores[:participants] = {}
            self.participants.each do |participant|
              scores[:participants][participant.id.to_s.to_sym] = participant.scores(questions)
        Severity: Minor
        Found in app/models/assignment.rb - About 1 hr to fix

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

            def save_topic_deadlines
              assignment = Assignment.find(params[:assignment_id])
              @assignment_submission_due_dates = assignment.due_dates.select {|due_date| due_date.deadline_type_id == 1 }
              @assignment_review_due_dates = assignment.due_dates.select {|due_date| due_date.deadline_type_id == 2 }
              due_dates = params[:due_date]
          Severity: Minor
          Found in app/controllers/sign_up_sheet_controller.rb - About 1 hr to fix

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

              def update_quiz
                @questionnaire = Questionnaire.find(params[:id])
                if @questionnaire.nil?
                  redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]
                  return
            Severity: Minor
            Found in app/controllers/questionnaires_controller.rb - About 1 hr to fix

              Function getShowHour has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              function getShowHour()
              {
                  var finalHour;
                  if (TimeMode==12)
                  {
              Severity: Minor
              Found in app/assets/javascripts/datetimepicker.js - 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 get_all_versions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                def get_all_versions
                  if self.review_mapping.response
                    @sorted_array = []
                    @prev = Response.all
                    @prev.each do |element|
              Severity: Minor
              Found in app/models/metareview_response_map.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 teamed_students has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.teamed_students(user, ip_address = nil)
                  students_teamed = {}
                  user.teams.each do |team|
                    next unless team.is_a?(AssignmentTeam)
                    # Teammates in calibration assignment should not be counted in teaming requirement.
              Severity: Minor
              Found in app/models/student_task.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 html_control has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                def html_control(tag_prompt_deployment, answer, user_id)
                  html = ""
                  unless answer.nil?
                    stored_tags = AnswerTag.where(tag_prompt_deployment_id: tag_prompt_deployment.id, answer_id: answer.id, user_id: user_id)
              
              
              Severity: Minor
              Found in app/models/tag_prompt.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 render_participant_info has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                def render_participant_info(topic, assignment, participants)
                  html = ''
                  if participants.present?
                    chooser_present = false
                    participants.each do |participant|
              Severity: Minor
              Found in app/helpers/sign_up_sheet_helper.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 perform has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                def perform(assignment_id, deadline_type, due_at)
                  self.assignment_id = assignment_id
                  self.deadline_type = deadline_type
                  self.due_at = due_at
              
              
              Severity: Minor
              Found in app/mailers/mail_worker.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

              Block has too many lines. [44/25]
              Open

                describe '#scores' do
                  before(:each) do
                    allow(AssignmentQuestionnaire).to receive(:find_by).with(assignment_id: 1, questionnaire_id: 1)
                                                                       .and_return(double('AssignmentQuestionnaire', used_in_round: 1))
                    allow(review_questionnaire).to receive(:symbol).and_return(:review)

              This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

              Block has too many lines. [44/25]
              Open

                describe "Testing copy functionality - " do
                  it "test for inherit" do
                    assignment = build(Assignment)
                    course = Course.new
                    course.name = "newCourse"

              This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

              Block has too many lines. [44/25]
              Open

              describe DeadlineHelper do
                before(:each) do
                  @deadline_type = create(:deadline_type)
                  @deadline_right = create(:deadline_right)
                  @topic_due_date = create(:topic_due_date, deadline_type: @deadline_type,

              This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

              Block has too many lines. [44/25]
              Open

                it "test2: in round 2, both students should be in review stage to review each other" do
                  # impersonate each participant submit their topics
                  submit_topic('student2064', '/sign_up_sheet/sign_up?id=1&topic_id=1', "https://google.com")
                  submit_topic('student2065', '/sign_up_sheet/sign_up?id=1&topic_id=2', "https://ncsu.edu")
                  # change deadline to make both in review stage in round 2

              This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

              Severity
              Category
              Status
              Source
              Language