Showing 685 of 1,401 total issues
Function exports
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
module.exports = Contract => ({
configureNetwork({ networkType, provider } = {}) {
// otherwise use existing value as default (at most one of these)
networkType = networkType || this.networkType;
provider = provider || this.currentProvider;
- 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 updateTransactionLogSaga
has 203 lines of code (exceeds 25 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!
Function normalize
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
static normalize(compilations) {
let contexts = [];
let sources = {
user: {}, //by compilation
internal: {} //by context
Function Debugger
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Debugger(): JSX.Element {
const { classes } = useStyles();
const [inputValue, setInputValue] = useInputState("");
const [sessionUpdated, { increment: sessionTick }] = useCounter();
const {
File index.js
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:evm:selectors");
import { createSelectorTree, createLeaf } from "reselect-tree";
import BN from "bn.js";
Function createStepSelectors
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createStepSelectors(step, state = null) {
let base = {
/**
* .trace
*
File index.js
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:session");
import * as Abi from "@truffle/abi-utils";
import * as Codec from "@truffle/codec";
Function isDesignatedInvalid
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
isDesignatedInvalid: function (
instructions,
index,
overlapFunctions,
node = undefined
- 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 printReturnValue
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
async printReturnValue() {
//note: when printing revert messages, this will do so in a somewhat
//different way than printRevertMessage does
const inspectOptions = {
colors: true,
File run.ts
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { zeroLinkReferences, formatLinkReferences } from "./shims";
import debugModule from "debug";
const debug = debugModule("compile:run");
import OS = require("os");
import semver from "semver";
Function formatStacktrace
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
formatStacktrace: function (stacktrace, indent = 2) {
//get message or panic code from stacktrace
const { message, panic, custom } = stacktrace[0];
//we want to print inner to outer, so first, let's
//reverse
- 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 resourceProcessorsForDefinitions
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const resourceProcessorsForDefinitions = <C extends Collections>(
definitions: Definitions<C>
): ResourceProcessors<C> => {
const names = <N extends CollectionName<C>>(collectionName: N) => {
const { mutable } = definitions[collectionName];
File index.js
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
const debug = require("debug")("source-map-utils");
const CodeUtils = require("@truffle/code-utils");
const Codec = require("@truffle/codec");
const Web3Utils = require("web3-utils");
const jsonpointer = require("json-pointer");
File reducers.js
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:txlog:reducers");
import { combineReducers } from "redux";
File configDefaults.ts
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as path from "path";
import Provider from "@truffle/provider";
import TruffleConfig from "./";
export const getInitialConfig = ({
Function exports
has a Cognitive Complexity of 37 (exceeds 5 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");
- 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 typeStringWithoutLocation
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
export function typeStringWithoutLocation(dataType: Format.Types.Type): string {
switch (dataType.typeClass) {
case "uint":
return dataType.typeHint || `uint${dataType.bits}`;
case "int":
- 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 arbitrary.ts
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as fc from "fast-check";
import { camelCase, pascalCase } from "change-case";
import wordLists from "./wordLists";
import type * as Types from "./types";
File errors.ts
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Contains the types for error and `ErrorResult` objects.
* @category Main Format
*
* @packageDocumentation
Function steps
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
steps(kind, data) {
const self = this;
const reporter = self.reporter;
const valueUnit = data.valueUnit || "ETH";
- 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"