mauriciabad/GradeCalc

View on GitHub
src/scripts/script.js

Summary

Maintainability
F
2 wks
Test Coverage

File script.js has 2064 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';
/* ------------------------------ START UP ------------------------------ */
var dashboard = document.getElementById('dashboard');
var editSubjectPopup = document.getElementById('edit-popup-content');
var viewSubjectPopup = document.getElementById('view-popup-content');
Severity: Major
Found in src/scripts/script.js - About 5 days to fix

    Function generateEditSubjectUIHTML has 169 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function generateEditSubjectUIHTML(id, subject, popup) {
      let exams = toNewEval(subject.evaluations);
      let evaluations = Object.keys(subject.evaluations);
      let grid = '';
      let newEvals = '';
    Severity: Major
    Found in src/scripts/script.js - About 6 hrs to fix

      Function readSubjectFromPopup has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

      function readSubjectFromPopup(popup) {
        let id = popup.querySelector('input[name="id"]').value;
      
        let newEval = {};
        let grid = popup.querySelector('.edit-popup-grid');
      Severity: Minor
      Found in src/scripts/script.js - About 5 hrs 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 editUIUpdateGrid has 140 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function editUIUpdateGrid(grid, e, popup) {
        const input = e.target;
        const elem = input.parentNode == grid ? input : input.parentNode;
        const conditionsElem = grid.parentNode.lastElementChild;
        let conditions = '';
      Severity: Major
      Found in src/scripts/script.js - About 5 hrs to fix

        Function gradeCalcAllEqual has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        function gradeCalcAllEqual(id, evaluation) {
          let sumUndoneExams = 0;
          let exams = [];
          let expectedMark = 0;
          for (const exam in subjects[id].evaluations[evaluation].exams) {
        Severity: Minor
        Found in src/scripts/script.js - About 4 hrs 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 evaluationTree has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        function evaluationTree(tree, values, now) {
          switch (tree.type) {
            case 'LogicalExpression':
              switch (tree.operator) {
                case '&&':
        Severity: Minor
        Found in src/scripts/script.js - About 4 hrs 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 getAndDisplayUserSubjects has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function getAndDisplayUserSubjects() {
          if (isAnonymous) {
            console.warn('To get user info you need to sign in');
            showToast(
              'Para guardar tus notas en la nube',
        Severity: Major
        Found in src/scripts/script.js - About 2 hrs to fix

          Function generateEditSubjectUIHTML has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function generateEditSubjectUIHTML(id, subject, popup) {
            let exams = toNewEval(subject.evaluations);
            let evaluations = Object.keys(subject.evaluations);
            let grid = '';
            let newEvals = '';
          Severity: Minor
          Found in src/scripts/script.js - About 2 hrs 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 updateNecesaryMark has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function updateNecesaryMark(id) {
            let evaluation = subjects[id].selectedEvaluation;
            let identifiers = getConditionIdentifiers(id, evaluation);
            for (const exam in subjects[id].necesaryMarks[evaluation]) {
              subjects[id].necesaryMarks[evaluation][exam] = undefined;
          Severity: Minor
          Found in src/scripts/script.js - About 2 hrs 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 editUIUpdateGrid has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function editUIUpdateGrid(grid, e, popup) {
            const input = e.target;
            const elem = input.parentNode == grid ? input : input.parentNode;
            const conditionsElem = grid.parentNode.lastElementChild;
            let conditions = '';
          Severity: Minor
          Found in src/scripts/script.js - About 2 hrs 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 isValidSubjectFromPopup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          function isValidSubjectFromPopup(subject) {
            // console.log(subject);
            // console.log(isEmpty(subject));
          
            let wrongValue = '';
          Severity: Minor
          Found in src/scripts/script.js - About 2 hrs 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 evaluationTree has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function evaluationTree(tree, values, now) {
            switch (tree.type) {
              case 'LogicalExpression':
                switch (tree.operator) {
                  case '&&':
          Severity: Major
          Found in src/scripts/script.js - About 2 hrs to fix

            Function readSubjectFromPopup has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function readSubjectFromPopup(popup) {
              let id = popup.querySelector('input[name="id"]').value;
            
              let newEval = {};
              let grid = popup.querySelector('.edit-popup-grid');
            Severity: Major
            Found in src/scripts/script.js - About 2 hrs to fix

              Function isValidSubjectFromPopup has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function isValidSubjectFromPopup(subject) {
                // console.log(subject);
                // console.log(isEmpty(subject));
              
                let wrongValue = '';
              Severity: Major
              Found in src/scripts/script.js - About 2 hrs to fix

                Function gradeCalcAllEqual has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function gradeCalcAllEqual(id, evaluation) {
                  let sumUndoneExams = 0;
                  let exams = [];
                  let expectedMark = 0;
                  for (const exam in subjects[id].evaluations[evaluation].exams) {
                Severity: Minor
                Found in src/scripts/script.js - About 2 hrs to fix

                  Function generateInputs has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function generateInputs(id) {
                    let html = '';
                    let types = {};
                  
                    for (const examName in subjects[id].evaluations[
                  Severity: Minor
                  Found in src/scripts/script.js - About 1 hr to fix

                    Function generateInputs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function generateInputs(id) {
                      let html = '';
                      let types = {};
                    
                      for (const examName in subjects[id].evaluations[
                    Severity: Minor
                    Found in src/scripts/script.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 generateBar has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function generateBar(id) {
                      let weight = 0;
                      let barHTML = '';
                      for (const exam in subjects[id].evaluations[subjects[id].selectedEvaluation]
                        .exams) {
                    Severity: Minor
                    Found in src/scripts/script.js - About 1 hr to fix

                      Function editGridFade has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function editGridFade(grid, type, n) {
                        let removed = false;
                        for (let element of grid.querySelectorAll(`*[data-${type}]`)) {
                          if (parseInt(element.dataset[type]) == n) {
                            element.classList.add(`edit-new-${type}`);
                      Severity: Minor
                      Found in src/scripts/script.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 displayNecesaryMark has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function displayNecesaryMark(id) {
                        let card = getCard(id);
                        let barUndone = card.getElementsByClassName('scolN');
                        let inUndone = card.getElementsByClassName('scolN2');
                      
                      
                      Severity: Minor
                      Found in src/scripts/script.js - About 1 hr to fix

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

                        function editGridFade(grid, type, n) {
                          let removed = false;
                          for (let element of grid.querySelectorAll(`*[data-${type}]`)) {
                            if (parseInt(element.dataset[type]) == n) {
                              element.classList.add(`edit-new-${type}`);
                        Severity: Minor
                        Found in src/scripts/script.js - About 1 hr to fix

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

                          function completeSubject(...subjects) {
                            let subject = Object.assign(
                              {
                                evaluations: {},
                                grades: {},
                          Severity: Minor
                          Found in src/scripts/script.js - About 1 hr to fix

                            Function updateNecesaryMark has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function updateNecesaryMark(id) {
                              let evaluation = subjects[id].selectedEvaluation;
                              let identifiers = getConditionIdentifiers(id, evaluation);
                              for (const exam in subjects[id].necesaryMarks[evaluation]) {
                                subjects[id].necesaryMarks[evaluation][exam] = undefined;
                            Severity: Minor
                            Found in src/scripts/script.js - About 1 hr to fix

                              Function autoUpdate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function autoUpdate(id) {
                                if (
                                  subjects[id].evaluation != undefined ||
                                  subjects[id].evaluations == undefined
                                ) {
                              Severity: Minor
                              Found in src/scripts/script.js - About 1 hr to fix

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

                                function autoUpdate(id) {
                                  if (
                                    subjects[id].evaluation != undefined ||
                                    subjects[id].evaluations == undefined
                                  ) {
                                Severity: Minor
                                Found in src/scripts/script.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 editGridUnfade has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function editGridUnfade(grid, type, n) {
                                  for (let element of grid.querySelectorAll(`*[data-${type}='${n}'`)) {
                                    if (
                                      (element.dataset.evaluation == undefined ||
                                        parseInt(element.dataset.evaluation) <
                                Severity: Minor
                                Found in src/scripts/script.js - About 55 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 toNewEval has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function toNewEval(evaluations) {
                                  let newEval = {};
                                  for (const evaluation in evaluations) {
                                    for (const exam in evaluations[evaluation].exams) {
                                      if (!newEval[exam]) newEval[exam] = {};
                                Severity: Minor
                                Found in src/scripts/script.js - About 55 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 (exam && examType && weight) {
                                            if (!newEval[evaluation]) newEval[evaluation] = {};
                                            if (!newEval[evaluation].exams) newEval[evaluation].exams = {};
                                            if (!newEval[evaluation].exams[exam])
                                              newEval[evaluation].exams[exam] = {};
                                Severity: Major
                                Found in src/scripts/script.js - About 45 mins to fix

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

                                  function updateFinalMark(id, confetti = true) {
                                    for (const evaluation in subjects[id].evaluations) {
                                      subjects[id].finalMark[evaluation] = 0;
                                      for (const exam in subjects[id].evaluations[evaluation].exams) {
                                        if (!isUndone(id, exam))
                                  Severity: Minor
                                  Found in src/scripts/script.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 uploadToDB has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function uploadToDB(db, ref, value) {
                                    if (!isAnonymous) {
                                      let obj = {};
                                      if (ref) {
                                        if (
                                  Severity: Minor
                                  Found in src/scripts/script.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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                    if (!userInfo.subjects[id]) userInfo.subjects[id] = {};
                                  Severity: Major
                                  Found in src/scripts/script.js - About 45 mins to fix

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

                                    function displayNecesaryMark(id) {
                                      let card = getCard(id);
                                      let barUndone = card.getElementsByClassName('scolN');
                                      let inUndone = card.getElementsByClassName('scolN2');
                                    
                                    
                                    Severity: Minor
                                    Found in src/scripts/script.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

                                    Avoid deeply nested control flow statements.
                                    Open

                                                if (
                                                  subjects[id].necesaryMarks[evaluation][exam] !== undefined &&
                                                  subjects[id].necesaryMarks[evaluation][exam] <
                                                    identifiers.types[type].value
                                                ) {
                                    Severity: Major
                                    Found in src/scripts/script.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                        if (!subjects[id]) subjects[id] = {};
                                      Severity: Major
                                      Found in src/scripts/script.js - About 45 mins to fix

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

                                        function addSubjects() {
                                          showLoader('Cargando tus asignaturas', 'dashboard');
                                          document.getElementById('search-subject-input').value = '';
                                        
                                          for (let id in subjectsToAdd) {
                                        Severity: Minor
                                        Found in src/scripts/script.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 toNewEvalNeeeeeeeeew has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        function toNewEvalNeeeeeeeeew(evaluations) {
                                          var evaluationNew = {};
                                          for (let evaluation in evaluations) {
                                            if (evaluations[evaluation].exams) return evaluations;
                                            evaluationNew[evaluation] = {};
                                        Severity: Minor
                                        Found in src/scripts/script.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

                                        Avoid deeply nested control flow statements.
                                        Open

                                                  if (canPass === false) {
                                                    subjects[id].necesaryMarks[evaluation][exam] = null;
                                                  } else {
                                                    subjects[id].necesaryMarks[evaluation][exam] = Math.max(
                                                      0,
                                        Severity: Major
                                        Found in src/scripts/script.js - About 45 mins to fix

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

                                          function generateBar(id) {
                                            let weight = 0;
                                            let barHTML = '';
                                            for (const exam in subjects[id].evaluations[subjects[id].selectedEvaluation]
                                              .exams) {
                                          Severity: Minor
                                          Found in src/scripts/script.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 findIdentifiersTree has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                          function findIdentifiersTree(tree, identifiers, types, id, evaluation) {
                                          Severity: Minor
                                          Found in src/scripts/script.js - About 35 mins to fix

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

                                            function editGridFadeOrUnfade(grid, element, check = ['exam', 'evaluation']) {
                                              for (const type of check) {
                                                if (
                                                  element.dataset[type] != undefined &&
                                                  parseInt(element.dataset[type]) < parseInt(grid.dataset[type + 's'])
                                            Severity: Minor
                                            Found in src/scripts/script.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 saveEditSubject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function saveEditSubject() {
                                              let newSubject = readSubjectFromPopup(editSubjectPopup);
                                              let id = newSubject.id;
                                            
                                              if (newSubject.shortName != subjects[id].shortName)
                                            Severity: Minor
                                            Found in src/scripts/script.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 completeSubject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function completeSubject(...subjects) {
                                              let subject = Object.assign(
                                                {
                                                  evaluations: {},
                                                  grades: {},
                                            Severity: Minor
                                            Found in src/scripts/script.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 findIdentifiersTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function findIdentifiersTree(tree, identifiers, types, id, evaluation) {
                                              switch (tree.type) {
                                                case 'LogicalExpression':
                                                case 'BinaryExpression':
                                                  if (
                                            Severity: Minor
                                            Found in src/scripts/script.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

                                            Avoid too many return statements within this function.
                                            Open

                                                return false;
                                            Severity: Major
                                            Found in src/scripts/script.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                          if (!now && values[tree['left'].name] == undefined) return true;
                                              Severity: Major
                                              Found in src/scripts/script.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                    return false;
                                                Severity: Major
                                                Found in src/scripts/script.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                      return false;
                                                  Severity: Major
                                                  Found in src/scripts/script.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                      return true;
                                                    Severity: Major
                                                    Found in src/scripts/script.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                    return (values[tree['left'].name] || 0) < tree['lerightft'].value;
                                                      Severity: Major
                                                      Found in src/scripts/script.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                            return false;
                                                        Severity: Major
                                                        Found in src/scripts/script.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                              return false;
                                                          Severity: Major
                                                          Found in src/scripts/script.js - About 30 mins to fix

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

                                                            function sortSubjectExams(subject) {
                                                              let newSubject = { ...subject };
                                                            
                                                              for (const evaluation in subject.evaluations) {
                                                                const examsSortedArray = Object.keys(subject.evaluations[evaluation].exams)
                                                            Severity: Minor
                                                            Found in src/scripts/script.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 updateCardGrades has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                            function updateCardGrades(id) {
                                                              let card = getCard(id);
                                                              for (let div of card.getElementsByClassName('subject-bar')[0].children) {
                                                                div.classList.add('scolN');
                                                              }
                                                            Severity: Minor
                                                            Found in src/scripts/script.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

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                card.innerHTML = ` <button onclick="deleteSubject('${id}')" class="subject-card-remove">
                                                                      <img src="media/trash.svg" alt="x" aria-label="Delete subject">
                                                                    </button>
                                                                    <button onclick="showEditSubject('${id}')" class="subject-card-info">
                                                                      <img src="media/edit.svg" alt="%" aria-label="Show subject information">
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 3 hrs to fix
                                                            src/scripts/script.js on lines 245..260

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 98.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                              getCard(
                                                                id
                                                              ).innerHTML = `<button onclick="deleteSubject('${id}')" class="subject-card-remove">
                                                              <img src="media/trash.svg" alt="x" aria-label="Delete subject">
                                                            </button>
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 3 hrs to fix
                                                            src/scripts/script.js on lines 274..287

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 98.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                if (
                                                                  subjects[id].necesaryMarks[subjects[id].selectedEvaluation][examName] ==
                                                                  null
                                                                ) {
                                                                  mark = 'ಥ_ಥ';
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 2 hrs to fix
                                                            src/scripts/script.js on lines 302..310

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 77.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                  if (
                                                                    subjects[id].necesaryMarks[subjects[id].selectedEvaluation][exam] ==
                                                                    null
                                                                  ) {
                                                                    mark = 'ಥ_ಥ';
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 2 hrs to fix
                                                            src/scripts/script.js on lines 357..365

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 77.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                            function getBarElem(id, exam) {
                                                              let elem = document.getElementById('bar-' + id + exam);
                                                              if (!elem) {
                                                                createSubjectCardCollapsed(id);
                                                                elem = document.getElementById('bar-' + id + exam);
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 1 hr to fix
                                                            src/scripts/script.js on lines 1000..1007

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 69.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                            function getInput(id, exam) {
                                                              let elem = document.getElementById('in-' + id + exam);
                                                              if (!elem) {
                                                                createSubjectCardCollapsed(id);
                                                                elem = document.getElementById('in-' + id + exam);
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 1 hr to fix
                                                            src/scripts/script.js on lines 1009..1016

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 69.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                            function generateViewSubjectUI(id, subject) {
                                                              let html = generateEditSubjectUIHTML(id, subject, 'view');
                                                            
                                                              viewSubjectPopup.innerHTML = html;
                                                            
                                                            
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 1 hr to fix
                                                            src/scripts/script.js on lines 565..574

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 68.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                            function generateEditSubjectUI(id, subject = subjects[id]) {
                                                              let html = generateEditSubjectUIHTML(id, subject, 'edit');
                                                            
                                                              editSubjectPopup.innerHTML = html;
                                                            
                                                            
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 1 hr to fix
                                                            src/scripts/script.js on lines 554..563

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 68.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                            function round(n, d = 2) {
                                                              return isNaN(n) || n === '' || n == undefined
                                                                ? undefined
                                                                : Math.floor(Math.round(n * 10 ** d)) / 10 ** d;
                                                            }
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 1 hr to fix
                                                            src/scripts/subject.js on lines 128..130

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 65.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                      if (
                                                                        tree['left'].type != 'Identifier' ||
                                                                        tree['right'].type != 'Literal'
                                                                      ) {
                                                                        return null;
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 1 hr to fix
                                                            src/scripts/script.js on lines 1250..1260

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 65.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                      if (
                                                                        tree['left'].type != 'Identifier' ||
                                                                        tree['right'].type != 'Literal' ||
                                                                        identifierCategory(tree['left'].name) != 'evaluations'
                                                                      ) {
                                                            Severity: Major
                                                            Found in src/scripts/script.js and 1 other location - About 1 hr to fix
                                                            src/scripts/script.js on lines 1239..1247

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 65.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 3 locations. Consider refactoring.
                                                            Open

                                                                  appendElement(
                                                                    grid,
                                                                    `<input style="grid-row: ${
                                                                      2 + parseInt(grid.dataset.exams)
                                                                    }; grid-column: 3;" class="edit-new-exam" type="number" name="mark"       value="" data-exam="${
                                                            Severity: Minor
                                                            Found in src/scripts/script.js and 2 other locations - About 30 mins to fix
                                                            src/scripts/script.js on lines 1608..1615
                                                            src/scripts/script.js on lines 1616..1623

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    case 'evaluation':
                                                                      element.style.gridColumn = `${
                                                                        parseInt(element.dataset[type]) + 5
                                                                      } / auto`;
                                                                      break;
                                                            Severity: Minor
                                                            Found in src/scripts/script.js and 1 other location - About 30 mins to fix
                                                            src/scripts/script.js on lines 1733..1737

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                  (element.dataset.exam == undefined ||
                                                                    parseInt(element.dataset.exam) < parseInt(grid.dataset.exams))
                                                            Severity: Minor
                                                            Found in src/scripts/script.js and 1 other location - About 30 mins to fix
                                                            src/scripts/script.js on lines 1703..1705

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    case 'exam':
                                                                      element.style.gridRow = `${
                                                                        parseInt(element.dataset[type]) + 2
                                                                      } / auto`;
                                                                      break;
                                                            Severity: Minor
                                                            Found in src/scripts/script.js and 1 other location - About 30 mins to fix
                                                            src/scripts/script.js on lines 1728..1732

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 3 locations. Consider refactoring.
                                                            Open

                                                                  appendElement(
                                                                    grid,
                                                                    `<input style="grid-row: ${
                                                                      2 + parseInt(grid.dataset.exams)
                                                                    }; grid-column: 1;" class="edit-new-exam" type="text"   name="exam"       value="" data-exam="${
                                                            Severity: Minor
                                                            Found in src/scripts/script.js and 2 other locations - About 30 mins to fix
                                                            src/scripts/script.js on lines 1616..1623
                                                            src/scripts/script.js on lines 1624..1631

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 3 locations. Consider refactoring.
                                                            Open

                                                                  appendElement(
                                                                    grid,
                                                                    `<input style="grid-row: ${
                                                                      2 + parseInt(grid.dataset.exams)
                                                                    }; grid-column: 2;" class="edit-new-exam" type="text"   name="examType"   value="" data-exam="${
                                                            Severity: Minor
                                                            Found in src/scripts/script.js and 2 other locations - About 30 mins to fix
                                                            src/scripts/script.js on lines 1608..1615
                                                            src/scripts/script.js on lines 1624..1631

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                  (element.dataset.evaluation == undefined ||
                                                                    parseInt(element.dataset.evaluation) <
                                                                      parseInt(grid.dataset.evaluations)) &&
                                                            Severity: Minor
                                                            Found in src/scripts/script.js and 1 other location - About 30 mins to fix
                                                            src/scripts/script.js on lines 1706..1707

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            There are no issues that match your filters.

                                                            Category
                                                            Status