Showing 134 of 443 total issues
Function menuTempl
has 589 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let menuTempl = function(webviews) {
const menu = [];
webviews = webviews || [];
// APP
File menuItems.js
has 685 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const {
app,
BrowserWindow,
ipcMain: ipc,
Menu,
Function menuTempl
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
Open
let menuTempl = function(webviews) {
const menu = [];
webviews = webviews || [];
// APP
- Read upRead up
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
Open
const _ = require('./utils/underscore.js');
const fs = require('fs');
const Q = require('bluebird');
const spawn = require('child_process').spawn;
const { dialog } = require('electron');
File windows.js
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
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 {
Function _checkForNewConfig
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_checkForNewConfig(restart) {
const nodeType = 'Geth';
let binariesDownloaded = false;
let nodeInfo;
File ipcProviderBackend.js
has 469 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
The IPC provider backend filter and tunnel all incoming request to the ethereum node.
@module ipcProviderBackend
*/
Function getDefaultOptionsForType
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getDefaultOptionsForType(type) {
const mainWebPreferences = {
mist: {
nodeIntegration: true /* necessary for webviews;
require will be removed through preloader */,
Function exports
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = () => {
let queue = [];
const prefix = 'entry_';
const MIST_SUBMENU_LIMIT = 100;
Function renderMoreDetails
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderMoreDetails() {
const {
estimatedGas,
executionFunction,
gasError,
File settings.js
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const { app } = require('electron');
const path = require('path');
const fs = require('fs');
const packageJson = require('../package.json');
const _ = require('./utils/underscore');
Function exports
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = () => {
let queue = [];
const prefix = 'entry_';
const MIST_SUBMENU_LIMIT = 100;
- Read upRead up
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
Open
__startProcess(nodeType, network, binPath, _syncMode) {
let syncMode = _syncMode;
if (nodeType === 'geth' && !syncMode) {
syncMode = DEFAULT_SYNCMODE;
}
Settings
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Settings {
constructor() {
if (!instance) {
instance = this;
}
File actions.js
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export function setWindowSize(height) {
return dispatch => {
dispatch({ type: '[CLIENT]:SET_WINDOW_SIZE:START', payload: { height } });
ipc.send('backendAction_setWindowSize', 580, height + 20);
};
Function render
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const tx = this.props.tx;
const networkString = this.props.networkString(tx.networkId);
let network = '';
if (networkString !== 'Main') {
Function renderDetails
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderDetails() {
const { tx, etherPriceUSD } = this.props;
if (!this.state.showDetails) {
return (
Function _sendRequest
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_sendRequest(isSync, event, payload, retry = false) {
const ownerId = event.sender.id;
log.trace('sendRequest', isSync ? 'sync' : 'async', ownerId, payload);
EthereumNode
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class EthereumNode extends EventEmitter {
constructor() {
super();
if (!instance) {
Function confirmTx
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function confirmTx(data) {
return async (dispatch, getState) => {
dispatch({ type: '[CLIENT]:CONFIRM_TX:START', payload: { data } });
// reject if sending to itself