FC-softwares/baseball-scoreboard

View on GitHub
app/js/settings.js

Summary

Maintainability
A
0 mins
Test Coverage

Showing 0 of 4 total issues

Function printUsers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Wontfix

function printUsers(LoggedUser){
const xmlt = new XMLHttpRequest();
xmlt.open('POST', '/getAuthUsers', true);
xmlt.setRequestHeader('Content-Type', 'application/json');
xmlt.send(`{"id":"${user}","token":"${token}"}`);
Severity: Minor
Found in app/js/settings.js - About 1 hr to fix

Function getCurrentUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Wontfix

function getCurrentUser (){
const xmlt = new XMLHttpRequest();
xmlt.open('POST', '/checkstat', true);
xmlt.setRequestHeader('Content-Type', 'application/json');
xmlt.send(`{"id":"${user}","token":"${token}"}`);
Severity: Minor
Found in app/js/settings.js - About 35 mins to fix

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

}else{
document.getElementById("BlackenLastInningTrue").classList.remove("btn-success");
document.getElementById("BlackenLastInningTrue").classList.add("btn-outline-success");
document.getElementById("BlackenLastInningFalse").classList.remove("btn-outline-danger");
document.getElementById("BlackenLastInningFalse").classList.add("btn-danger");
Severity: Major
Found in app/js/settings.js and 1 other location - About 3 hrs to fix
app/js/settings.js on lines 25..30

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

if(data.BlackenLastInning){
document.getElementById("BlackenLastInningTrue").classList.remove("btn-outline-success");
document.getElementById("BlackenLastInningTrue").classList.add("btn-success");
document.getElementById("BlackenLastInningFalse").classList.remove("btn-danger");
document.getElementById("BlackenLastInningFalse").classList.add("btn-outline-danger");
Severity: Major
Found in app/js/settings.js and 1 other location - About 3 hrs to fix
app/js/settings.js on lines 30..35

There are no issues that match your filters.

Category
Status