ethereum/mist

View on GitHub

Showing 134 of 443 total issues

Function menuTempl has 589 lines of code (exceeds 25 allowed). Consider refactoring.
Open

let menuTempl = function(webviews) {
  const menu = [];
  webviews = webviews || [];

  // APP
Severity: Major
Found in modules/menuItems.js - About 2 days to fix

    File menuItems.js has 685 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const {
      app,
      BrowserWindow,
      ipcMain: ipc,
      Menu,
    Severity: Major
    Found in modules/menuItems.js - About 1 day to fix

      Function menuTempl has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
      Open

      let menuTempl = function(webviews) {
        const menu = [];
        webviews = webviews || [];
      
        // APP
      Severity: Minor
      Found in modules/menuItems.js - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File ethereumNode.js has 549 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const _ = require('./utils/underscore.js');
      const fs = require('fs');
      const Q = require('bluebird');
      const spawn = require('child_process').spawn;
      const { dialog } = require('electron');
      Severity: Major
      Found in modules/ethereumNode.js - About 1 day to fix

        File windows.js has 542 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const { app, BrowserWindow, ipcMain: ipc } = require('electron');
        const Settings = require('./settings');
        const log = require('./utils/logger').create('Windows');
        const EventEmitter = require('events').EventEmitter;
        import {
        Severity: Major
        Found in modules/windows.js - About 1 day to fix

          Function _checkForNewConfig has 203 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _checkForNewConfig(restart) {
              const nodeType = 'Geth';
              let binariesDownloaded = false;
              let nodeInfo;
          
          
          Severity: Major
          Found in modules/clientBinaryManager.js - About 1 day to fix

            File ipcProviderBackend.js has 469 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
            The IPC provider backend filter and tunnel all incoming request to the ethereum node.
            
            @module ipcProviderBackend
            */
            Severity: Minor
            Found in modules/ipc/ipcProviderBackend.js - About 7 hrs to fix

              Function getDefaultOptionsForType has 153 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                getDefaultOptionsForType(type) {
                  const mainWebPreferences = {
                    mist: {
                      nodeIntegration: true /* necessary for webviews;
                                  require will be removed through preloader */,
              Severity: Major
              Found in modules/windows.js - About 6 hrs to fix

                Function exports has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = () => {
                  let queue = [];
                  const prefix = 'entry_';
                  const MIST_SUBMENU_LIMIT = 100;
                
                
                Severity: Major
                Found in modules/preloader/include/mistAPI.js - About 5 hrs to fix

                  Function renderMoreDetails has 142 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    renderMoreDetails() {
                      const {
                        estimatedGas,
                        executionFunction,
                        gasError,
                  Severity: Major
                  Found in interface/components/SendTx/ExecutionContext.js - About 5 hrs to fix

                    File settings.js has 399 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    const { app } = require('electron');
                    const path = require('path');
                    const fs = require('fs');
                    const packageJson = require('../package.json');
                    const _ = require('./utils/underscore');
                    Severity: Minor
                    Found in modules/settings.js - About 5 hrs to fix

                      Function exports has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = () => {
                        let queue = [];
                        const prefix = 'entry_';
                        const MIST_SUBMENU_LIMIT = 100;
                      
                      
                      Severity: Minor
                      Found in modules/preloader/include/mistAPI.js - About 5 hrs to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function __startProcess has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        __startProcess(nodeType, network, binPath, _syncMode) {
                          let syncMode = _syncMode;
                          if (nodeType === 'geth' && !syncMode) {
                            syncMode = DEFAULT_SYNCMODE;
                          }
                      Severity: Major
                      Found in modules/ethereumNode.js - About 4 hrs to fix

                        Settings has 35 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Settings {
                          constructor() {
                            if (!instance) {
                              instance = this;
                            }
                        Severity: Minor
                        Found in modules/settings.js - About 4 hrs to fix

                          File actions.js has 345 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          export function setWindowSize(height) {
                            return dispatch => {
                              dispatch({ type: '[CLIENT]:SET_WINDOW_SIZE:START', payload: { height } });
                              ipc.send('backendAction_setWindowSize', 580, height + 20);
                            };
                          Severity: Minor
                          Found in interface/actions.js - About 4 hrs to fix

                            Function render has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              render() {
                                const tx = this.props.tx;
                                const networkString = this.props.networkString(tx.networkId);
                                let network = '';
                                if (networkString !== 'Main') {
                            Severity: Major
                            Found in interface/components/TxHistory/TxRow.js - About 4 hrs to fix

                              Function renderDetails has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                renderDetails() {
                                  const { tx, etherPriceUSD } = this.props;
                              
                                  if (!this.state.showDetails) {
                                    return (
                              Severity: Major
                              Found in interface/components/TxHistory/TxRow.js - About 4 hrs to fix

                                Function _sendRequest has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  _sendRequest(isSync, event, payload, retry = false) {
                                    const ownerId = event.sender.id;
                                
                                    log.trace('sendRequest', isSync ? 'sync' : 'async', ownerId, payload);
                                
                                
                                Severity: Major
                                Found in modules/ipc/ipcProviderBackend.js - About 4 hrs to fix

                                  EthereumNode has 32 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class EthereumNode extends EventEmitter {
                                    constructor() {
                                      super();
                                  
                                      if (!instance) {
                                  Severity: Minor
                                  Found in modules/ethereumNode.js - About 4 hrs to fix

                                    Function confirmTx has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function confirmTx(data) {
                                      return async (dispatch, getState) => {
                                        dispatch({ type: '[CLIENT]:CONFIRM_TX:START', payload: { data } });
                                    
                                        // reject if sending to itself
                                    Severity: Major
                                    Found in interface/actions.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language