tolulope-od/banka

View on GitHub
www/js/fetchSingleAccountHistory.js

Summary

Maintainability
C
1 day
Test Coverage

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

    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 handleStatusChange has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const handleStatusChange = () => {
        const currentStatus = document.getElementById('accnt-status-btn').innerHTML;
        let newStatus;
        if (currentStatus === 'Deactivate Account') {
          newStatus = 'dormant';
      Severity: Minor
      Found in www/js/fetchSingleAccountHistory.js - About 1 hr to fix

        Function handleAccountDebit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const handleAccountDebit = () => {
          const debitAmount = document.getElementById('debit-amount').value;
          const debitBtn = document.getElementById('debit-btn');
          const accountNumber = localStorage.getItem('banka-account-number-view');
          const token = localStorage.getItem('banka-app-token');
        Severity: Minor
        Found in www/js/fetchSingleAccountHistory.js - About 1 hr to fix

          Function handleAccountCredit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const handleAccountCredit = () => {
            const creditAmount = document.getElementById('credit-amount').value;
            const creditBtn = document.getElementById('credit-btn');
            const accountNumber = localStorage.getItem('banka-account-number-view');
            const token = localStorage.getItem('banka-app-token');
          Severity: Minor
          Found in www/js/fetchSingleAccountHistory.js - About 1 hr to fix

            Function handleAccountDelete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const handleAccountDelete = () => {
              const accountNumber = localStorage.getItem('banka-account-number-view');
              const token = localStorage.getItem('banka-app-token');
              const headers = new Headers();
              headers.append('Content-Type', 'application/json');
            Severity: Minor
            Found in www/js/fetchSingleAccountHistory.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status