ece517-p3/expertiza

View on GitHub

Showing 2,813 of 2,813 total issues

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

  def self.get(_sortvar = nil, _sortorder = nil, _user_id = nil, _show = nil, _parent_id = nil, _search = nil); end
Severity: Minor
Found in app/models/node.rb - About 45 mins to fix

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

      def signed_up_topic(team)
        # The purpose is to return the topic that the contributor has signed up to do for this assignment.
        # Returns a record from the sign_up_topic table that gives the topic_id for which the contributor has signed up
        # Look for the topic_id where the team_id equals the contributor id (contributor is a team or a participant)
    
    
    Severity: Minor
    Found in app/models/review_assignment.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_parents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def get_parents
        parents = []
        seen = {}
    
        current = self.id
    Severity: Minor
    Found in app/models/role.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 response_map_to_metareview has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def response_map_to_metareview(metareviewer)
        response_map_set = Array.new(review_mappings)
        # Reject response maps without responses
        response_map_set.reject! {|response_map| response_map.response.empty? }
        raise 'There are no reviews to metareview at this time for this assignment.' if response_map_set.empty?
    Severity: Minor
    Found in app/models/assignment.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 save_new_questions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def save_new_questions(questionnaire_id)
        if params[:new_question]
          # The new_question array contains all the new questions
          # that should be saved to the database
          params[:new_question].keys.each do |question_key|
    Severity: Minor
    Found in app/controllers/questionnaires_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_children has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def get_children(sortvar = nil, sortorder = nil, user_id = nil, show = nil, _parent_id = nil, search = nil)
    Severity: Minor
    Found in app/models/questionnaire_type_node.rb - About 45 mins to fix

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

        def add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments = nil, current_user = nil
      Severity: Minor
      Found in app/models/response.rb - About 45 mins to fix

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

          def self.export_details_fields(detail_options)
            fields = []
            fields << 'Team ID / Author ID' if detail_options['team_id'] == 'true'
            fields << 'Reviewee (Team / Student Name)' if detail_options['team_name'] == 'true'
            fields << 'Reviewer' if detail_options['reviewer'] == 'true'
        Severity: Minor
        Found in app/models/assignment.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_available_roles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def get_available_roles
            ids = []
        
            current = self.parent_id
            while current
        Severity: Minor
        Found in app/models/role.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_children has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def get_children(sortvar = nil, sortorder = nil, user_id = nil, show = nil, _parent_id = nil, search = nil)
        Severity: Minor
        Found in app/models/course_node.rb - About 45 mins to fix

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

            def view_heatgrid(participant_id, type)
              # get participant, team, questionnaires for assignment.
              @participant = AssignmentParticipant.find(participant_id)
              @assignment = @participant.assignment
              @team = @participant.team
          Severity: Minor
          Found in app/helpers/grades_helper.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 has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def self.get(sortvar = 'name', _sortorder = 'desc', user_id = nil, show = nil, _parent_id = nil, _search = nil)
          Severity: Minor
          Found in app/models/course_node.rb - About 45 mins to fix

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

              def self.update_calculated_penalty_objects(penalty_policy)
                @penalty_objs = CalculatedPenalty.all
                @penalty_objs.each do |pen|
                  @participant = AssignmentParticipant.find(pen.participant_id)
                  @assignment = @participant.assignment
            Severity: Minor
            Found in app/models/late_policy.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 new_quiz has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def new_quiz
                valid_request = true
                @assignment_id = params[:aid] # creating an instance variable to hold the assignment id
                @participant_id = params[:pid] # creating an instance variable to hold the participant id
                assignment = Assignment.find(@assignment_id)
            Severity: Minor
            Found in app/controllers/questionnaires_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_pie_chart_url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.get_pie_chart_url(labels, values)
                return  "" if labels.length != values.length
            
                address = "http://chart.apis.google.com/chart?cht=p3&chs=300x125"
                max = 100.0
            Severity: Minor
            Found in app/helpers/charts_helper.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 sort_reviewer_by_review_volume_desc has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def sort_reviewer_by_review_volume_desc
                @reviewers.each do |r|
                  r.overall_avg_vol,
                      r.avg_vol_in_round_1,
                      r.avg_vol_in_round_2,
            Severity: Minor
            Found in app/helpers/review_mapping_helper.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 delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def delete(force = nil)
                begin
                  maps = ReviewResponseMap.where(reviewed_object_id: self.id)
                  maps.each {|map| map.delete(force) }
                rescue StandardError
            Severity: Minor
            Found in app/models/assignment.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 export has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.export(csv, parent_id, options)
                @assignment = Assignment.find(parent_id)
                @questions = {}
                questionnaires = @assignment.questionnaires
                questionnaires.each do |questionnaire|
            Severity: Minor
            Found in app/models/assignment.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

                          color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'
            Severity: Major
            Found in app/helpers/review_mapping_helper.rb - About 45 mins to fix

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

                def generate_keys
                  # check if we are replacing a digital certificate already generated
                  replacing_key = true unless self.digital_certificate.nil?
              
                  # generate the new key pair
              Severity: Minor
              Found in app/models/user.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

              Severity
              Category
              Status
              Source
              Language