Showing 1,401 of 1,401 total issues
Avoid deeply nested control flow statements. Open
if (!(name in fn)) {
//don't overwrite anything!
fn[name] = enumeration;
}
Function display
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
display: async function(config) {
const networks = await this.deployed(config);
const { networkNames, starNetworks } = Object.keys(networks)
.sort()
.reduce(
- 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 parseKnownNetworks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async parseKnownNetworks(
{ networks, currentProvider, setNetwork, network_id },
gasLimit
) {
if (!networks && Object.keys(networks).length === 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
Avoid deeply nested control flow statements. Open
for (let index = 0; index < values.length; index++) {
const { value } = values[index];
const prefix = paddedPrefixes[index];
const formatted = DebugUtils.formatValue(value, maxLength);
this.config.logger.log(prefix + formatted);
Function parsePrintoutLines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
parsePrintoutLines(userArgs, currentLines) {
let { beforeLines, afterLines } = currentLines;
for (const argument of userArgs) {
// ignore an option with length less than 2,such as a bare + or -
if (argument.length < 2) continue;
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(
projectEncoder: ProjectEncoder,
compilation: Codec.Compilations.Compilation,
contract: Codec.Compilations.Contract,
artifact?: Artifact
- 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
Avoid deeply nested control flow statements. Open
if (name) {
//case 12a: it has a name
this.config.logger.log("Returned values:");
this.config.logger.log(`${name}: ${prettyData}`);
} else {
Avoid deeply nested control flow statements. Open
if (errorIndex !== null) {
const stepSpinner = new Spinner(
"core:debug:interpreter:step",
"Stepping..."
);
Function setUpConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setUpConfig: config => {
if (!config.resolver) {
config.resolver = new Resolver(config);
}
- 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 connect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
connect: function ({ ipcOptions, solidityLogDisplayPrefix }) {
const debugServer = debug("develop:ipc:server");
const debugClient = debug("develop:ipc:client");
const debugRPC = debug("develop:ganache");
const ganacheColor = {
- 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
Avoid deeply nested control flow statements. Open
if (
matchingSources.some(shortSource =>
matchingSources.every(
source =>
typeof source.sourcePath !== "string" || //just ignore these I guess?
Function getSolcFromCacheOrUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async getSolcFromCacheOrUrl(versionConstraint: string, index: number = 0) {
// go through all sources (compilerRoots) trying to locate a
// suitable version of the Solidity compiler
const { compilerRoots, events } = this.config;
if (!compilerRoots || compilerRoots.length === 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 compile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async compile(options) {
const config = prepareConfig(options);
if (config.events) config.events.emit("compile:start");
- 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 getSortedFetcherConstructors
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getSortedFetcherConstructors(
userFetcherNames?: string[]
): FetcherConstructor[] {
let sortedFetchers: FetcherConstructor[] = [];
if (userFetcherNames) {
- 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 getSolcVersionFileName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getSolcVersionFileName(
version: string,
allVersions: SolidityCompilersList
): string | null {
if (allVersions.releases[version]) return allVersions.releases[version];
- 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 require
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
require(importPath: string, searchPath: string) {
if (importPath.indexOf(".") === 0 || importPath.indexOf("/") === 0) {
return null;
}
const contractName = path.basename(importPath, ".sol");
- 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 find
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async find<N extends CollectionName<C>>(
collectionName: N,
options: (Id.IdObject<C, N> | undefined)[] | PouchDB.Find.FindRequest<{}>
): Promise<(SavedInput<C, N> | undefined)[]> {
const log = debug.extend(`${collectionName}:find`);
- 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
Avoid deeply nested control flow statements. Open
for (const [
generatedSourceIndex,
source
] of generatedSources.entries()) {
yield {
Function resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async resolve(
{ id, resource, previous },
{ limit, includeSelf = false },
{ workspace }
) {
- 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 list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async list() {
const userSpecification = this.version;
let strategy: Docker | Native | Local | VersionRange | undefined;
const useDocker = this.docker;
- 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"