Showing 57 of 76 total issues
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}`);
Function completeSubject
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function completeSubject(...subjects) {
let subject = Object.assign(
{
evaluations: {},
grades: {},
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;
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
) {
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
) {
- Read upRead up
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 shape
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var shape = function shape(element) {
var list = [
// Square
function (e) {
var size = Math.round((Math.random() + 0.5) * 10) + 'px';
Function confetti
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
window.confetti = function (root)
- Read upRead up
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 gradeCalcAllEqual
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
gradeCalcAllEqual(evaluation = this.selectedEvaluation) {
const passMark = this.evaluations[evaluation].passMark || 5;
let sumUndoneExams = 0;
let exams = [];
let currentFinalMark = 0;
- Read upRead up
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] = {};
- Read upRead up
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) <
- Read upRead up
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 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))
- Read upRead up
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] = {};
- Read upRead up
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
) {
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 (
- Read upRead up
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,
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) {
- Read upRead up
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] = {};
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');
- Read upRead up
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] = {};
Avoid deeply nested control flow statements. Open
if (!subjects[id]) subjects[id] = {};