expertiza/expertiza

View on GitHub
app/assets/javascripts/view_team_in_grades.js

Summary

Maintainability
C
1 day
Test Coverage

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

    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

      Function drawQuestionRow has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function drawQuestionRow(priorQuestionNum, questionNum, roundNum, tRow, gridWidth, tooltipText, reviewNum, numRounds, roundPrefix, tBody) {
      Severity: Major
      Found in app/assets/javascripts/view_team_in_grades.js - About 1 hr to fix

        Function col_sort has a Cognitive Complexity of 10 (exceeds 5 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

        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 drawReviewRow has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function drawReviewRow(tRow, questionNum, reviewNum, gridWidth, rowData, rIndex, tooltipText) {
        Severity: Major
        Found in app/assets/javascripts/view_team_in_grades.js - About 50 mins to fix

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

          function drawReviewRow(tRow, questionNum, reviewNum, gridWidth, rowData, rIndex, tooltipText) {
              tRow.id = "hg_row" + questionNum + "_" + reviewNum;
              tRow.setAttribute("data-questionnum", questionNum);
              for (let cIndex = 0; cIndex < gridWidth; ++cIndex) {
                  let cell = tRow.insertCell();
          Severity: Minor
          Found in app/assets/javascripts/view_team_in_grades.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

          Function onMetricToggle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function onMetricToggle(clicked_metric) {
              if (clicked_metric.checked == true) {
                  var hide = false
              } else {
                  var hide = true
          Severity: Minor
          Found in app/assets/javascripts/view_team_in_grades.js - About 25 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

          There are no issues that match your filters.

          Category
          Status