timi-codes/Banka

View on GitHub

Showing 48 of 58 total issues

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

if (emailTextField) {
emailTextField[0].value = email;
if (emailTextField[1]) {
emailTextField[1].value = email;
}
Severity: Minor
Found in frontend/js/dashboard.js and 1 other location - About 40 mins to fix
frontend/js/dashboard.js on lines 178..183

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

fetch(`${baseUrl}/accounts`, {
headers: {
'Content-Type': 'application/json',
'x-access-token': `Bearer ${token}`,
},
Severity: Major
Found in frontend/js/dashboard.js and 3 other locations - About 30 mins to fix
frontend/js/customer.js on lines 344..379
frontend/js/dashboard.js on lines 462..498
frontend/js/main.js on lines 175..210

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

fetch(`${baseUrl}/auth/signup`, {
headers: {
'Content-Type': 'application/json',
},
mode: 'cors',
Severity: Major
Found in frontend/js/main.js and 3 other locations - About 30 mins to fix
frontend/js/customer.js on lines 344..379
frontend/js/dashboard.js on lines 135..171
frontend/js/dashboard.js on lines 462..498

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

fetch(transactUrl, {
headers: {
"Content-Type": "application/json",
"x-access-token": `Bearer ${token}`
},
Severity: Major
Found in frontend/js/customer.js and 3 other locations - About 30 mins to fix
frontend/js/dashboard.js on lines 135..171
frontend/js/dashboard.js on lines 462..498
frontend/js/main.js on lines 175..210

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

fetch(`${baseUrl}/auth/create/staff`, {
headers: {
'Content-Type': 'application/json',
'x-access-token': `Bearer ${token}`,
},
Severity: Major
Found in frontend/js/dashboard.js and 3 other locations - About 30 mins to fix
frontend/js/customer.js on lines 344..379
frontend/js/dashboard.js on lines 135..171
frontend/js/main.js on lines 175..210

Function search has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
Open

const search = () => {
var input, filter, tr, td, i, txtValue;
input = document.getElementById("searchInput");
filter = input.value.toUpperCase();
tr = accountTable.getElementsByTagName("tr");
Severity: Minor
Found in frontend/js/dashboard.js - About 25 mins to fix

Function onclick has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
Open

signupButton.onclick = () => {
if (!signupEmailInput.value.match(/\S+@\S+\.\S+/)) {
errorsTag[0].innerHTML = 'Enter a valid email address';
}else if(signupFirstNameInput.value === '' || signupFirstNameInput.value === null){
errorsTag[0].innerHTML = 'First Name is required';
Severity: Minor
Found in frontend/js/main.js - About 25 mins to fix

Function onclick has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
Open

trasactButton.onclick = () => {
if (amountTextField.value === "" || amountTextField.value === null) {
errorTag[0].innerHTML = "Enter an amount";
} else if (!amountTextField.value.match(/^\d+(\.\d{1,2})?$/)) {
errorTag[0].innerHTML = "Enter a valid amount";
Severity: Minor
Found in frontend/js/customer.js - About 25 mins to fix
Severity
Category
Status
Source
Language