Showing 685 of 1,401 total issues
Function configureManagedGanache
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function configureManagedGanache(config, networkConfig, mnemonic) {
const host = getFirstDefinedValue(
networkConfig.host,
"127.0.0.1" // Use as default host
);
Function link
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
link: async function (library, destinations, deployer) {
let eventArgs;
let libraryName = library.contractName;
if (libraryName == null && library.constructor) {
//allow for the possibility that library is an instance rather
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
module.exports = async function (options) {
const Config = require("@truffle/config");
const OS = require("os");
const log = options.logger
- 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 parse
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const parse = function (args) {
if (args.length === 0) {
return null;
}
- 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 resolve
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
async resolve(importPath: string) {
if (importPath === `truffle${path.sep}DeployedAddresses.sol`) {
const sourceFiles = await findContracts(this.options.contracts_directory);
const buildDirFiles: string[] = fse.existsSync(
- 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 file
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function file(options: RequireOptions) {
const sourceFilePath = path.resolve(options.file);
expectOptions(options, ["file"]);
- 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 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
deploy: function (constructorABI) {
const constructor = this;
const web3 = constructor.web3;
return function () {
Consider simplifying this complex logical expression. Open
if (start !== undefined && length !== undefined) {
//node-based (well, source-range-based) breakpoint
return (
sourceId === currentSourceId &&
start === currentStart &&
Consider simplifying this complex logical expression. Open
if (
decoding.kind === "function" &&
(decoding.abi.name === "tryAggregate" ||
decoding.abi.name === "tryBlockAndAggregate") &&
decoding.abi.inputs.length === 2 &&
ProjectEncoder
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
export class ProjectEncoder {
private provider: Provider | null;
private ens: any | null; //any should be ENS, sorry >_>
private registryAddress: string | undefined = undefined;
private ensCache: ENSCache = {};
Function MenuButton
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MenuButton(): JSX.Element {
const { connect } = useConnect({ connector: new InjectedConnector() });
const { disconnect } = useDisconnect();
const { isConnected } = useAccount();
const {
File vyper-json.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
const debug = require("debug")("compile-vyper:vyper-json");
const execSync = require("child_process").execSync;
const path = require("path");
const semver = require("semver");
const Common = require("@truffle/compile-common");
Function PromiEvent
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PromiEvent(justPromise, bugger = undefined, isDeploy = false) {
const { resolve, reject, eventEmitter } = new Web3PromiEvent(justPromise);
const originalStackTrace = new Error().stack;
Function Menu
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Menu = (props: Props) => {
const { config, db, project, onDone } = props;
const [mode, setMode] = useState<"wait" | ModeName<MenuModes>>("wait");
const handleSelect = ({ value }) => {
Function EtherScanApiKeyPrompt
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EtherScanApiKeyPrompt() {
const { classes } = useStyles();
const [etherscanApiKey, setEtherscanApiKey, removeEtherscanApiKey] =
useLocalStorage({
Function _
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
(scopes, scope, pointer, sourceId, language) => {
let variables = {};
if (scope !== undefined) {
let cur =
scope.id !== undefined ? scope.id : makePath(sourceId, pointer);
- 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 getUserDefinedGlobals
has a Cognitive Complexity of 17 (exceeds 5 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
- 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 normalizeSourcePath
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const normalizeSourcePath = (url = defaultPath) => {
// Process filepath resolution
//
if (url.startsWith(".") || url.startsWith("/") || url.startsWith("~")) {
debug({ in: url, out: path.normalize(url) });
- 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 constructSlot
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private async constructSlot(
variable: number | string,
...indices: unknown[]
): Promise<{ slot?: Storage.Slot; type?: Format.Types.Type }> {
//base case: we need to locate the variable and its definition
- 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 init
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public async init(): Promise<void> {
this.contractCode = Conversion.toHexString(
await this.getCode(
this.contractAddress,
await this.providerAdapter.getBlockNumber() //not "latest" because regularized
- 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"