ece517-p3/expertiza

View on GitHub

Showing 2,813 of 2,813 total issues

Function collapseSubDirectory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function collapseSubDirectory(row) {
  var image = $('expand.'+row);
  var index = 0;
  var visible = true;
  while (true) {
Severity: Minor
Found in app/assets/javascripts/submissions.js - 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/folder_node.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (this.props.require_quiz) {
                  moreContent.push(
                    <span>
                      <a title="View quiz questions" href={"/student_quizzes/review_questions?id="+(parseInt(this.props.id)/2).toString()+"&type=Assignment"}>
                        <img src="/assets/tree_view/view-survey-24.png" />
    Severity: Major
    Found in app/assets/javascripts/tree_display.jsx - About 45 mins to fix

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

        def self.questionnaire_unique?
          self.find_each do |assignment|
            assignment.questionnaire_types.each do |questionnaire_type|
              questionnaire_list = []
              assignment.questionnaires.each do |questionnaire|
      Severity: Minor
      Found in app/models/analytic/assignment_analytic.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 = nil, sortorder = nil, user_id = nil, show = nil, parent_id = nil, _search = nil)
      Severity: Minor
      Found in app/models/assignment_node.rb - About 45 mins to fix

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

          def self.import(row, _row_header, session, _id = nil)
            if row.length != 5
              raise ArgumentError, "Not enough items: expect 3 columns: your login name, your full name (first and last name, not seperated with the delimiter), and your email."
            end
            questionnaire = Questionnaire.find_by_id(_id)
        Severity: Minor
        Found in app/models/question.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

                    if (this.props.allow_suggestions) {
                      moreContent.push(
                        <span>
                          <a title="View suggestions" href={"/suggestion/list?id="+(parseInt(this.props.id)/2).toString()+"&type=Assignment"}>
                            <img src="/assets/tree_view/view-suggestion-24.png" />
        Severity: Major
        Found in app/assets/javascripts/tree_display.jsx - About 45 mins to fix

          Function checkIfFileSelected has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function checkIfFileSelected(operation){
                  var tbl = document.getElementById("file_table");
                  var numChecks = 0;
              var flag = 0;
                  for(i=0; i<document.forms[2].elements.length; i++){
          Severity: Minor
          Found in app/assets/javascripts/shared.js - 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 isvalid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def isvalid(choice_info)
              valid = "valid"
              valid = "Please make sure all questions have text" if self.txt == ''
              correct_count = 0
              choice_info.each do |_idx, value|
          Severity: Minor
          Found in app/models/multiple_choice_radio.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 prepare_review_response has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.prepare_review_response(assignment, maps, review_final_versions, round)
              symbol = if round.nil?
                         :review
                       else
                         ("review round" + round.to_s).to_sym
          Severity: Minor
          Found in app/models/review_response_map.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 handle_duplicate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.handle_duplicate(team, name, id, handle_dups, teamtype)
              return name if team.nil? # no duplicate
              return nil if handle_dups == "ignore" # ignore: do not create the new team
              if handle_dups == "rename" # rename: rename new team
                if teamtype.is_a?(CourseTeam)
          Severity: Minor
          Found in app/models/team.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

          Function initalizetooltip has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function initalizetooltip(){
          var all_links=document.getElementsByTagName("a")
          if (enablearrowhead){
          tiparrow=document.createElement("img")
          tiparrow.setAttribute("src", arrowheadimg[0])
          Severity: Minor
          Found in app/assets/javascripts/balloontip.js - 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 = nil, sortorder = nil, user_id = nil, show = nil, parent_id = nil, _search = nil)
          Severity: Minor
          Found in app/models/questionnaire_node.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (parseInt(this.props.max_team_size) > 1) {
                          moreContent.push(
                            <span>
                              <a title="Create teams" href={"/teams/list?id="+(parseInt(this.props.id)/2).toString()+"&type=Assignment"}>
                                <img src="/assets/tree_view/create-teams-24.png" />
            Severity: Major
            Found in app/assets/javascripts/tree_display.jsx - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if (this.props.has_topic) {
                              // Moved content out of this to the block outside this containing "if" statement
                          }
              Severity: Major
              Found in app/assets/javascripts/tree_display.jsx - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if(this.props.is_intelligent) {
                              moreContent.push(
                                <a title="Intelligent Assignment" href={"/lottery/run_intelligent_assignment/"+(parseInt(this.props.id)/2).toString()}>
                                  <img src="/assets/tree_view/run-lottery.png" />
                                </a>
                Severity: Major
                Found in app/assets/javascripts/tree_display.jsx - About 45 mins to fix

                  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); end
                  Severity: Minor
                  Found in app/models/node.rb - About 45 mins to fix

                    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)
                    Severity: Minor
                    Found in app/models/folder_node.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                            if (((entry.name && entry.name.indexOf(_this.props.filterText) !== -1) ||
                                                (entry.creation_date && entry.creation_date.indexOf(_this.props.filterText) !== -1) ||
                                                (entry.updated_date && entry.updated_date.indexOf(_this.props.filterText) !== -1)) &&
                                                (entry.private == false)) {
                                                _rows.push(<ContentTableRow
                      Severity: Major
                      Found in app/assets/javascripts/tree_display.jsx - About 45 mins to fix

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

                          def self.get_reviewer_assessments_for(team, reviewer)
                            map = where(reviewee_id: team.id, reviewer_id: reviewer.id)
                            Response.where(map_id: map).sort {|m1, m2| m1.version_num and m2.version_num ? m2.version_num <=> m1.version_num : (m1.version_num ? -1 : 1) }[0]
                          end
                        Severity: Minor
                        Found in app/models/response_map.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