Showing 685 of 1,401 total issues
Function callstackAndCodexSaga
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function* callstackAndCodexSaga() {
if (yield select(evm.current.step.isExceptionalHalting)) {
//let's handle this case first so we can be sure everything else is *not*
//an exceptional halt
debug("exceptional halt!");
- 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 exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = async function (options) {
const OS = require("os");
const { promisify } = require("util");
const loadConfig = require("../../loadConfig");
const { Environment } = require("@truffle/environment");
- 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 exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = async function (config) {
const debugLog = debug.extend("guard");
// only check if deploying on MAINNET
// NOTE: this includes Ethereum Classic as well as Ethereum as they're only
// distinguishable by checking their chainIds, 2 and 1 respectively.
- 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 collectAllocationInfo
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function collectAllocationInfo(
compilations: Compilations.Compilation[]
): ContextAndAllocationInfo {
let contexts: Contexts.Contexts = {};
let deployedContexts: Contexts.Contexts = {};
- 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 repairOldContracts
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function repairOldContracts(contracts: Contracts): Contracts {
const contractNames = Object.values(contracts)
.map(source => Object.keys(source))
.flat();
if (contractNames.some(name => name.includes(":"))) {
- 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 _deploy
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async _deploy(
options: Config,
context: MigrationContext,
deployer: DeployerInterface,
resolver: ResolverIntercept,
- 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 Stack
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function Stack(): JSX.Element | null {
const { classes } = useStyles();
const {
state: {
debugger: { session }
- 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 callstackAndCodexSaga
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function* callstackAndCodexSaga() {
if (yield select(evm.current.step.isExceptionalHalting)) {
//let's handle this case first so we can be sure everything else is *not*
//an exceptional halt
debug("exceptional halt!");
Function testConnection
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
testConnection: function (options) {
let networkCheckTimeout, networkType;
const { networks, network } = options;
if (networks && networks[network]) {
networkCheckTimeout =
Function getUserDefinedGlobals
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
getUserDefinedGlobals({ accounts, interfaceAdapter, web3 }) {
// exit if feature should be disabled
if (this.options["require-none"]) return;
// exit if no hydrate options are set
Function generateReport
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateReport(rawStack, location, status, message) {
//step 1: process combined frames
let callstack = [];
//we're doing a C-style loop here!
//because we want to skip some items <grin>
Function exports
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function (options) {
const Config = require("@truffle/config");
const TruffleError = require("@truffle/error");
const WorkflowCompile = require("@truffle/workflow-compile").default;
const CodeUtils = require("@truffle/code-utils");
Function evalAndPrintExpression
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
async evalAndPrintExpression(raw, indent, suppress) {
let variables = await this.session.variables({ indicateUnknown: true });
//if we're just dealing with a single variable, handle that case
//separately (so that we can do things in a better way for that
File index.js
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:stacktrace:selectors");
import { createSelectorTree, createLeaf } from "reselect-tree";
Function decodeReturnValue
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function* decodeReturnValue() {
const userDefinedTypes = yield select(data.views.userDefinedTypes);
const state = yield select(data.next.state); //next state has the return data
const allocations = yield select(data.info.allocations);
const contexts = yield select(data.views.contexts);
Consider simplifying this complex logical expression. Open
} else if (
decoding.kind === "function" &&
decoding.abi.name === "aggregate3Value" &&
decoding.abi.inputs.length === 1 &&
decoding.abi.inputs[0].type === "tuple[]" &&
Function resolvers
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
get resolvers(): IResolvers<any, Context<C>> {
const log = debug.extend(`${this.resource}:resolvers`);
log("Generating...");
// setup loggers for specific resolvers
Function begin
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function* begin() {
const pointer = yield select(txlog.current.pointer);
const newPointer = yield select(txlog.current.nextActionPointer);
const origin = yield select(txlog.transaction.origin);
debug("origin: %o", pointer);
Function recordAllocations
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function* recordAllocations() {
const contracts = yield select(data.views.contractAllocationInfo);
const referenceDeclarations = yield select(data.views.referenceDeclarations);
const userDefinedTypesByCompilation = yield select(
data.views.userDefinedTypesByCompilation
Function processDeploymentError
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
async processDeploymentError(data) {
const error = data.estimateError || data.error;
data.reason = data.error ? data.error.reason : null;