Showing 43 of 43 total issues
File account.test.js
has 703 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import '@babel/polyfill';
import chai from 'chai';
import chaiHttp from 'chai-http';
import app from '../index';
File user.test.js
has 578 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import '@babel/polyfill';
import chai from 'chai';
import chaiHttp from 'chai-http';
import app from '../index';
File transaction.test.js
has 548 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import '@babel/polyfill';
import chai from 'chai';
import chaiHttp from 'chai-http';
import app from '../index';
File auth.test.js
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import '@babel/polyfill';
import chai from 'chai';
import chaiHttp from 'chai-http';
import app from '../index';
Function creditAccount
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async creditAccount(req, res) {
const { accountNumber } = req.params;
const { creditAmount } = req.body;
if (req.decoded.type !== 'staff') {
return res.status(401).json({
Function debitAccount
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async debitAccount(req, res) {
const { accountNumber } = req.params;
const { debitAmount } = req.body;
if (req.decoded.type !== 'staff') {
return res.status(401).json({
Function fetchAccountTransactionHistory
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fetchAccountTransactionHistory = () => {
para.innerHTML = '';
para.innerHTML =
'<center><img src="https://res.cloudinary.com/tolulope-od/image/upload/v1557908999/loading_o1y5v6.gif" width="150" /></center>';
modalContent.appendChild(para);
Function createTable
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createTable = async () => {
try {
const query = `DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS accounts CASCADE;
DROP TABLE IF EXISTS transactions CASCADE;
Function getSingleAccount
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async getSingleAccount(req, res) {
const { accountNumber } = req.params;
if (req.decoded.type === 'staff') {
const accountDetails = await accounts.select(
['*'],
File fetchSingleAccountHistory.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-unused-vars */
/* global window, document, fetch, localStorage, Headers */
/* eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["errors"] }] */
const API_PREFIX = 'https://bankaa-app.herokuapp.com/api/v1/';
Function addNewStaff
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const addNewStaff = () => {
para.innerHTML = '';
if (userType.value !== '') {
addStaffBtn.value = 'LOADING..';
addStaffBtn.disabled = true;
Function debitAccount
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static debitAccount(req, res) {
const { accountNumber } = req.params;
const { debitAmount } = req.body;
if (req.decoded.type !== 'staff') {
return res.status(401).json({
Function fetchAllAccounts
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fetchAllAccounts = () => {
para.innerHTML = '';
para.innerHTML =
'<center><img src="https://res.cloudinary.com/tolulope-od/image/upload/v1557908999/loading_o1y5v6.gif" width="150" /></center>';
modalContent.appendChild(para);
Function handleAccountSubmit
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleAccountSubmit = () => {
para.innerHTML = '';
if (selected.value !== '') {
text = document.createTextNode(`Creating your account....`);
para.appendChild(text);
Function registerUser
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const registerUser = e => {
e.preventDefault();
clearErrors(error);
signUpBtn.value = 'LOADING..';
signUpBtn.disabled = true;
Function creditAccount
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static creditAccount(req, res) {
const { accountNumber } = req.params;
const { creditAmount } = req.body;
if (req.decoded.type !== 'staff') {
return res.status(401).json({
Function fetchAccounts
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fetchAccounts = () => {
para.innerHTML = '';
para.innerHTML =
'<center><img src="https://res.cloudinary.com/tolulope-od/image/upload/v1557908999/loading_o1y5v6.gif" width="150" /></center>';
modalContent.appendChild(para);
Function loginUser
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const loginUser = e => {
e.preventDefault();
clearErrors(error);
loginBtn.value = 'LOADING..';
loginBtn.disabled = true;
Function createStaff
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async createStaff(req, res) {
if (req.decoded.isAdmin) {
const { firstName, lastName, email, admin } = req.body;
const existingUser = await users.select(['email'], [`email='${email}'`]);
if (existingUser.length > 0) {
Function fetchStaff
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fetchStaff = () => {
displayModalWithImage(
'<center><img src="https://res.cloudinary.com/tolulope-od/image/upload/v1557908999/loading_o1y5v6.gif" width="150" /></center>'
);
const token = localStorage.getItem('banka-app-token');