Showing 443 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
File menuItems.js
has 685 lines of code (exceeds 250 allowed). Consider refactoring. Open
const {
app,
BrowserWindow,
ipcMain: ipc,
Menu,
Function menuTempl
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. 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
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
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
_checkForNewConfig(restart) {
const nodeType = 'Geth';
let binariesDownloaded = false;
let nodeInfo;
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
*/
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 */,
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;
Function renderMoreDetails
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderMoreDetails() {
const {
estimatedGas,
executionFunction,
gasError,
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');
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;
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (options.sendData) {
if (_.isString(options.sendData)) {
this.send(options.sendData);
} else if (_.isObject(options.sendData)) {
for (const key in options.sendData) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 127.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (opts.sendData) {
if (_.isString(opts.sendData)) {
this.send(opts.sendData);
} else if (_.isObject(opts.sendData)) {
for (const key in opts.sendData) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 127.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
}
Settings
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Settings {
constructor() {
if (!instance) {
instance = this;
}
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);
};
Similar blocks of code found in 2 locations. Consider refactoring. Open
select(id) {
const filteredId = prefix + filterId(id);
queue.push({ action: 'selectMenu', id: filteredId });
for (const e in this.entries) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
select(id) {
const filteredId = prefix + filterId(id);
queue.push({ action: 'selectMenu', id: filteredId });
for (const e in this.entries) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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') {