Showing 685 of 1,401 total issues
Function DashProvider
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
function DashProvider({ children }: DashProviderProps): JSX.Element {
const { isConnected, address } = useAccount();
const { chain } = useNetwork();
const [state, dispatch] = useReducer(reducer, initialState);
const initCalled = useRef(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
File console.js
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
const repl = require("repl");
const provision = require("@truffle/provisioner");
const {
Web3Shim,
createInterfaceAdapter
File execute.js
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
const debug = require("debug")("contract:execute");
const PromiEvent = require("./promievent");
const EventEmitter = require("events");
const utils = require("./utils");
const StatusError = require("./statuserror");
Function printReturnValue
has a Cognitive Complexity of 34 (exceeds 5 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,
- 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 codex
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
function codex(state = DEFAULT_CODEX, action) {
let newState, topCodex, topCodexNoZero;
const updateFrameStorage = (frame, address, slot, value) => ({
...frame,
Function determineBreakpoints
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
determineBreakpoints(args) {
const currentLocation = this.session.view(controller.current.location);
const currentStart = currentLocation.sourceRange
? currentLocation.sourceRange.start
Function init
has 126 lines of code (exceeds 25 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
Function connect
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
async connect(): Promise<void> {
if (this._socket) {
switch (this._socket.readyState) {
case WebSocket.CONNECTING:
debug(
Function requiredSources
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
export async function requiredSources({
allPaths,
updatedPaths,
resolve,
shouldIncludePath,
- 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 properties.js
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
const utils = require("../utils");
const web3Utils = require("web3-utils");
module.exports = {
contract_name: {
ProjectDecoder
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
export class ProjectDecoder {
private providerAdapter: ProviderAdapter;
private compilations: Compilations.Compilation[];
private contexts: Contexts.Contexts = {}; //all contexts
Function decodeMagic
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function* decodeMagic(
dataType: Format.Types.MagicType,
pointer: Pointer.SpecialPointer,
info: Evm.EvmInfo
): Generator<DecoderRequest, Format.Values.MagicResult, Uint8Array | null> {
Function isDesignatedInvalid
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
isDesignatedInvalid: function (
instructions,
index,
overlapFunctions,
node = undefined
Function reducer
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const reducer = (state: State, action: Action): State => {
const { type, data } = action;
switch (type) {
case "set-decoder":
return { ...state, ...data };
Function determineBreakpoints
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
determineBreakpoints(args) {
const currentLocation = this.session.view(controller.current.location);
const currentStart = currentLocation.sourceRange
? currentLocation.sourceRange.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 typeStringWithoutLocation
has 110 lines of code (exceeds 25 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":
Function Contract
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Contract(contract) {
var instance = this;
var constructor = instance.constructor;
// Disambiguate between .at() and .new()
Session
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Session {
/**
* @param {Array<Compilations>} compilations
* @param {Web3Provider} provider - web3 provider
* txHash parameter is now optional!
File reducers.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:evm:reducers");
import { combineReducers } from "redux";
File Messages.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* A module that formats output for the Migrations reporter.
*/
class Messages {
constructor(reporter) {