Showing 685 of 1,401 total issues
Function MantineGlobal
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MantineGlobal(): JSX.Element {
return (
<Global
styles={theme => {
const { colors, colorScheme, white, fn } = theme;
Function parseQuotesAndEscapes
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function parseQuotesAndEscapes(args, escapeCharacters = "\\") {
const quoteCharacters = "\"'"; //note we will handle the two quote types differently
let argArray = [];
let currentArg = "";
let currentQuote = 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
File etherscan.ts
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("source-fetcher:etherscan");
// untyped import since no @types/web3-utils exists
const Web3Utils = require("web3-utils");
data
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
current: {
/**
* data.current.state
*/
state: {
Function constructSlot
has 97 lines of code (exceeds 25 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
Function resolve
has 95 lines of code (exceeds 25 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(
Function errors
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
errors(kind, data) {
const prefix = " *** Deployment Failed ***\n\n";
const kinds = {
migrateErr: () =>
Function parseParameterListWithRemainder
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function parseParameterListWithRemainder(parameterList: string): {
parameters: Parameter[];
remaining: string;
} {
if (parameterList === "") {
- 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 decodeTransactionWithAdditionalContexts
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async decodeTransactionWithAdditionalContexts(
transaction: DecoderTypes.Transaction,
additionalContexts: Contexts.Contexts = {},
additionalAllocations?: {
[
Function abiParameterToType
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function abiParameterToType(abi: Parameter): Format.Types.Type {
let typeName = abi.type;
let typeHint = abi.internalType;
//first: is it an array?
let arrayMatch = typeName.match(/(.*)\[(\d*)\]$/);
Function resolveRelations
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function resolveRelations(relationship: "ancestor" | "descendant") {
const {
reverseRelationship,
superlativeOption,
heightBoundOption,
Spinner
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
export class Spinner {
name: string;
constructor(name: string, options: Partial<SpinnerOptions>);
constructor(name: string, text: string);
Function refs
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
(
assignments,
identifiers,
definitions,
scopes,
- 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 useStyles
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useStyles = createStyles((theme, _params, getRef) => {
const {
colors,
colorScheme,
white,
Function start
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
async start() {
if (this.httpServer?.listening) {
return;
}
Function getFunctionsByProgramCounter
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
getFunctionsByProgramCounter: function (
instructions,
asts,
overlapFunctions,
compilationId
- 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 parseCode
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function parseCode(
hexString: string,
{ maxInstructionCount, attemptStripMetadata }: DisassemblyOptions = {}
): Instruction[] {
// Convert to an array of bytes
- 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 interpretAggregate
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async interpretAggregate(
decoding: Codec.CalldataDecoding,
transaction: DecoderTypes.Transaction,
additionalContexts: Contexts.Contexts = {},
additionalAllocations?: {
File DashProvider.tsx
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useReducer, useEffect, useRef, useMemo, useCallback } from "react";
import { useAccount, useNetwork } from "wagmi";
import { sha1 } from "object-hash";
import { deleteDB } from "idb/with-async-ittr";
import type { ReceivedMessageLifecycle } from "@truffle/dashboard-message-bus-client";
Function executeDeployment
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
executeDeployment(contract, args) {
const self = this;
return async function () {
await self._preFlightCheck(contract);