aceberg/ExerciseDiary

View on GitHub

Showing 11 of 19 total issues

Function makeChart has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function makeChart(heat, hcolor, sets) {
    let ldata = lowerData(heat);
    var ctx = document.getElementById('matrix-chart').getContext('2d');
    window.myMatrix = new Chart(ctx, {
        type: 'matrix',
Severity: Major
Found in internal/web/public/js/heatmap.js - About 3 hrs to fix

    Function setStatsPage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function setStatsPage(sets, hcolor, off, step) {
        let start = 0, end = 0;
        let dates = [], ws = [], reps = [], exs = []; 
    
        let ex = document.getElementById("ex-value").value;
    Severity: Minor
    Found in internal/web/public/js/stats.js - About 1 hr to fix

      Function statsChart has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function statsChart(id, dates, ws, wcolor, xticks) {
          
          const ctx = document.getElementById(id);
      
          if (sChart){
      Severity: Minor
      Found in internal/web/public/js/stats.js - About 1 hr to fix

        Function weightChart has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function weightChart(id, dates, ws, wcolor, xticks) {
            
            const ctx = document.getElementById(id);
        
            if (wChart){
        Severity: Minor
        Found in internal/web/public/js/weight-chart.js - About 1 hr to fix

          Function setStatsPage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function setStatsPage(sets, hcolor, off, step) {
              let start = 0, end = 0;
              let dates = [], ws = [], reps = [], exs = []; 
          
              let ex = document.getElementById("ex-value").value;
          Severity: Minor
          Found in internal/web/public/js/stats.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 setWeights has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function setWeights(weights, wcolor, off, step) {
              let start = 0, end = 0;
              let dates = [], ws = [];
          
              offset = offset + off;
          Severity: Minor
          Found in internal/web/public/js/weight.js - About 1 hr to fix

            Function statsChart has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function statsChart(id, dates, ws, wcolor, xticks) {
            Severity: Minor
            Found in internal/web/public/js/stats.js - About 35 mins to fix

              Function weightChart has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function weightChart(id, dates, ws, wcolor, xticks) {
              Severity: Minor
              Found in internal/web/public/js/weight-chart.js - About 35 mins to fix

                Function setWeights has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                function setWeights(weights, wcolor, off, step) {
                    let start = 0, end = 0;
                    let dates = [], ws = [];
                
                    offset = offset + off;
                Severity: Minor
                Found in internal/web/public/js/weight.js - About 35 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 setFormContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function setFormContent(sets, date) {
                    window.sessionStorage.setItem("today", date);
                    document.getElementById('todayEx').innerHTML = "";
                    document.getElementById("formDate").value = date;
                    document.getElementById("realDate").value = date;
                Severity: Minor
                Found in internal/web/public/js/index.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

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

                function addAllGroup(exs, gr) {
                
                    // console.log('GR =', gr);
                    // console.log('SETS =', exs);
                
                
                Severity: Minor
                Found in internal/web/public/js/index.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

                Severity
                Category
                Status
                Source
                Language