tolulope-od/banka

View on GitHub

Showing 43 of 43 total issues

File account.test.js has 703 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import '@babel/polyfill';
import chai from 'chai';
import chaiHttp from 'chai-http';
import app from '../index';

Severity: Major
Found in test/account.test.js - About 1 day to fix

    File user.test.js has 578 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import '@babel/polyfill';
    import chai from 'chai';
    import chaiHttp from 'chai-http';
    import app from '../index';
    
    
    Severity: Major
    Found in test/user.test.js - About 1 day to fix

      File transaction.test.js has 548 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import '@babel/polyfill';
      import chai from 'chai';
      import chaiHttp from 'chai-http';
      import app from '../index';
      
      
      Severity: Major
      Found in test/transaction.test.js - About 1 day to fix

        File auth.test.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import '@babel/polyfill';
        import chai from 'chai';
        import chaiHttp from 'chai-http';
        import app from '../index';
        
        
        Severity: Minor
        Found in test/auth.test.js - About 6 hrs to fix

          Function creditAccount has 81 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static async creditAccount(req, res) {
              const { accountNumber } = req.params;
              const { creditAmount } = req.body;
              if (req.decoded.type !== 'staff') {
                return res.status(401).json({
          Severity: Major
          Found in server/controllers/TransactionController.js - About 3 hrs to fix

            Function debitAccount has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              static async debitAccount(req, res) {
                const { accountNumber } = req.params;
                const { debitAmount } = req.body;
                if (req.decoded.type !== 'staff') {
                  return res.status(401).json({
            Severity: Major
            Found in server/controllers/TransactionController.js - About 3 hrs to fix

              Function fetchAccountTransactionHistory has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              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);
              Severity: Major
              Found in www/js/fetchSingleAccountHistory.js - About 3 hrs to fix

                Function createTable has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                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;
                Severity: Major
                Found in server/db/seeder.js - About 2 hrs to fix

                  Function getSingleAccount has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    static async getSingleAccount(req, res) {
                      const { accountNumber } = req.params;
                      if (req.decoded.type === 'staff') {
                        const accountDetails = await accounts.select(
                          ['*'],
                  Severity: Major
                  Found in server/controllers/AccountController.js - About 2 hrs to fix

                    File fetchSingleAccountHistory.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
                    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/';
                    Severity: Minor
                    Found in www/js/fetchSingleAccountHistory.js - About 2 hrs to fix

                      Function addNewStaff has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const addNewStaff = () => {
                        para.innerHTML = '';
                        if (userType.value !== '') {
                          addStaffBtn.value = 'LOADING..';
                          addStaffBtn.disabled = true;
                      Severity: Major
                      Found in www/js/addStaff.js - About 2 hrs to fix

                        Function debitAccount has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          static debitAccount(req, res) {
                            const { accountNumber } = req.params;
                            const { debitAmount } = req.body;
                            if (req.decoded.type !== 'staff') {
                              return res.status(401).json({
                        Severity: Major
                        Found in server/dummyControllers/TransactionController.js - About 2 hrs to fix

                          Function fetchAllAccounts has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          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);
                          Severity: Major
                          Found in www/js/fetchAccounts.js - About 2 hrs to fix

                            Function handleAccountSubmit has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const handleAccountSubmit = () => {
                              para.innerHTML = '';
                              if (selected.value !== '') {
                                text = document.createTextNode(`Creating your account....`);
                                para.appendChild(text);
                            Severity: Major
                            Found in www/js/createBankAccount.js - About 2 hrs to fix

                              Function registerUser has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const registerUser = e => {
                                e.preventDefault();
                                clearErrors(error);
                                signUpBtn.value = 'LOADING..';
                                signUpBtn.disabled = true;
                              Severity: Major
                              Found in www/js/signUpAuth.js - About 2 hrs to fix

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

                                  static creditAccount(req, res) {
                                    const { accountNumber } = req.params;
                                    const { creditAmount } = req.body;
                                    if (req.decoded.type !== 'staff') {
                                      return res.status(401).json({
                                Severity: Major
                                Found in server/dummyControllers/TransactionController.js - About 2 hrs to fix

                                  Function fetchAccounts has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                  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);
                                  Severity: Major
                                  Found in www/js/accounts.js - About 2 hrs to fix

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

                                    const loginUser = e => {
                                      e.preventDefault();
                                      clearErrors(error);
                                      loginBtn.value = 'LOADING..';
                                      loginBtn.disabled = true;
                                    Severity: Major
                                    Found in www/js/loginAuth.js - About 2 hrs to fix

                                      Function createStaff has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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) {
                                      Severity: Minor
                                      Found in server/controllers/UserController.js - About 1 hr to fix

                                        Function fetchStaff has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                        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');
                                        Severity: Minor
                                        Found in www/js/users.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language