Showing 1,401 of 1,401 total issues
Function stacktraceSaga
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function* stacktraceSaga() {
const currentLocation = yield select(stacktrace.current.strippedLocation);
const lastLocation = yield select(stacktrace.current.lastPosition);
const returnCounter = yield select(stacktrace.current.returnCounter);
let positionUpdated = false;
- 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 mappedPaths
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function mappedPaths(state = DEFAULT_PATHS, action) {
switch (action.type) {
case actions.MAP_PATH_AND_ASSIGN:
let { address, slot, typeIdentifier, parentType } = action;
//how this case works: first, we find the spot in our table (based on
- 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 _
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_: createLeaf(["./raw", "./inlined/raw"], (scopes, inlined) =>
scopes && inlined
? Object.assign(
{},
...Object.entries(scopes).map(([id, scope]) => {
- 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 aboutToModify
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
(node, invocation, index, next, nextInvocation, isContextChange) => {
//ensure: current instruction is not a context change (because if it is
//we cannot rely on the data.next selectors, but also if it is we know
//we're not about to call a modifier or base constructor!)
//we also want to return false if we can't find things for whatever
- 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 formatBlockSpecifier
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const formatBlockSpecifier = (block: BlockSpecifier): string => {
if (typeof block === "string" && stringWhitelist.includes(block)) {
// block is one of 'latest', 'pending', 'earliest', or 'genesis'
return block === "genesis"
? // convert old web3 input format which uses 'genesis'
- 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 startDebugger
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async startDebugger(compilations) {
const startMessage = DebugUtils.formatStartMessage(
this.txHash !== undefined
);
const specifiedRegistry = this.config.noEns ? null : this.config.registry; //specified at the command line
- 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 updatePrintouts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
updatePrintouts(userArgs, selections, printOuts) {
let tempPrintouts = new Set();
for (let argument of userArgs) {
let fullSelection;
if (argument[0] === "+" || argument[0] === "-") {
- 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 configure
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const configure = <C extends Config>(
options: Options<C>
): (<I extends Base.Input<Batch<C>>, O extends Base.Output<Batch<C>>>(
inputs: Base.Inputs<Batch<C>, I>
) => Process<Base.Outputs<Batch<C>, I & O>>) =>
- 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 makeParseImports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function makeParseImports(parser: any) {
const parseImports = (body: string) => {
try {
return Parser.parseImports(body, parser);
} catch (err) {
- 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 lastCompletedMigration
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
lastCompletedMigration: async function (options: Config): Promise<number> {
let Migrations: any; // I don't think we have a good type for this yet
try {
Migrations = options.resolver.require("Migrations");
- 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 _withRetriesAsync
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private async _withRetriesAsync(f: Function) {
const { maxRetries, retryDelayMsec } = this._options;
for (let tryCount = 0; tryCount <= maxRetries; tryCount++) {
try {
- 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 removeCompleteSpanPairs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function removeCompleteSpanPairs(spanTags: string[] | null) {
if (spanTags === null) return [];
let stillNeedsProcessing: boolean = true;
while (stillNeedsProcessing) {
let spanPairRemovedThisPass: boolean = false;
- 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 createSession
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function createSession({
txHash,
compilations,
ganacheOptions,
fetchingOptions,
- 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 constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(compilations, provider, moduleOptions, txHash) {
/**
* @private
*/
const { store, sagaMiddleware } = configureStore(reducer, rootSaga, [
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function (buildDir, options) {
const Artifactor = require("@truffle/artifactor");
const { Resolver } = require("@truffle/resolver");
const Migrate = require("@truffle/migrate").default;
const { Environment } = require("@truffle/environment");
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(options) {
super();
EventEmitter.call(this);
expect.options(options, [
Function postDeploy
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async postDeploy(data) {
let message;
if (data.deployed) {
const txCostReport =
await data.contract.interfaceAdapter.getTransactionCostReport(
Function init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async init(): Promise<void> {
if (this.provider) {
debug("provider given!");
if (this.registryAddress !== undefined) {
debug("using custom registry address: %o", this.registryAddress);
Function deriveChild
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deriveChild(
index: number,
isHardened: boolean,
privateKey: Buffer,
publicKey: Uint8Array,
Function repairOldContracts
has 27 lines of code (exceeds 25 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(":"))) {