Showing 685 of 1,401 total issues
File decoders.ts
has 1877 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("decoder:decoders");
import * as Abi from "@truffle/abi-utils";
import * as Codec from "@truffle/codec";
File index.js
has 1227 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:data:selectors");
import { createSelectorTree, createLeaf } from "reselect-tree";
import jsonpointer from "json-pointer";
Function interpreter
has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring. Open
async interpreter(cmd) {
cmd = cmd.trim();
let cmdArgs, splitArgs;
debug("cmd %s", cmd);
- 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 index.js
has 1029 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:data:sagas");
import { put, takeEvery, select } from "redux-saga/effects";
Function variablesAndMappingsSaga
has 487 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* variablesAndMappingsSaga() {
// stack is only ready for interpretation after the last step of each
// source range
//
// the data module always looks at the result of a particular opcode
Function interpreter
has 399 lines of code (exceeds 25 allowed). Consider refactoring. Open
async interpreter(cmd) {
cmd = cmd.trim();
let cmdArgs, splitArgs;
debug("cmd %s", cmd);
File encoders.ts
has 813 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("encoder:encoders");
import { FixedNumber as EthersFixedNumber } from "@ethersproject/bignumber";
import { getAddress } from "@ethersproject/address";
Function normalize
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
static normalize(compilations) {
let contexts = [];
let sources = {
user: {}, //by compilation
internal: {} //by context
- 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 index.js
has 738 lines of code (exceeds 250 allowed). Consider refactoring. Open
const OS = require("os");
const debug = require("debug")("debug-utils");
const util = require("util");
const Codec = require("@truffle/codec");
const BN = require("bn.js");
Function variablesAndMappingsSaga
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
function* variablesAndMappingsSaga() {
// stack is only ready for interpretation after the last step of each
// source range
//
// the data module always looks at the result of a particular opcode
- 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 printer.js
has 726 lines of code (exceeds 250 allowed). Consider refactoring. Open
const debugModule = require("debug");
const debug = debugModule("lib:debug:printer");
const path = require("path");
const util = require("util");
Function transactionLog
has 326 lines of code (exceeds 25 allowed). Consider refactoring. Open
function transactionLog(state = DEFAULT_TX_LOG, action) {
const { pointer, newPointer, step } = action;
const node = state.byPointer[pointer];
switch (action.type) {
case actions.RECORD_ORIGIN:
File interpreter.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
const debugModule = require("debug");
const debug = debugModule("lib:debug:interpreter");
const path = require("path");
const util = require("util");
Function transactionLog
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
function transactionLog(state = DEFAULT_TX_LOG, action) {
const { pointer, newPointer, step } = action;
const node = state.byPointer[pointer];
switch (action.type) {
case actions.RECORD_ORIGIN:
- 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 configProps
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
export const configProps = ({
configObject
}: {
configObject: TruffleConfig;
}) => {
- 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 content.tsx
has 585 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from "react";
import * as C from "../react";
import * as data from "./data";
import styles from "./styles.module.scss";
Function exports
has 243 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function (options) {
const debug = require("debug")("core:commands:call");
const fs = require("fs");
const util = require("util");
const { Environment } = require("@truffle/environment");
Function updateTransactionLogSaga
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
function* updateTransactionLogSaga() {
const pointer = yield select(txlog.current.pointer); //log pointer, not AST pointer
const step = yield select(txlog.current.step);
if (yield select(txlog.current.isHalting)) {
//note that we process this case first so that it overrides the others!
- 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 steps
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
steps(kind, data) {
const self = this;
const reporter = self.reporter;
const valueUnit = data.valueUnit || "ETH";
Function createStepSelectors
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
function createStepSelectors(step, state = null) {
let base = {
/**
* .trace
*
- 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"