Showing 685 of 1,401 total issues
DebugPrinter
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DebugPrinter {
constructor(config, session) {
this.config = config;
this.session = session;
this.select = expr => {
File index.ts
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import WebSocket from "isomorphic-ws";
// must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
import "../polyfill";
import axios from "axios";
Function get
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get() {
let networkConfig;
try {
networkConfig = configObject.network_config;
} catch {
File index.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import debugModule from "debug";
const debug = debugModule("debugger:sourcemapping:selectors");
import { createSelectorTree, createLeaf } from "reselect-tree";
import SourceMapUtils from "@truffle/source-map-utils";
File index.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import debugModule from "debug";
const debug = debugModule("debugger:web3:sagas");
import {
all,
Function resolver
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
(sources, functions) => breakpoint => {
let adjustedBreakpoint;
if (breakpoint.node === undefined) {
let line = breakpoint.line;
if (line < 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 getProcessedInstructionsForBinary
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getProcessedInstructionsForBinary: function (sources, binary, sourceMap) {
if (!sources || !binary) {
return [];
}
debug("sourceMap: %O", sourceMap);
Function constructor
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
projectEncoder: ProjectEncoder,
compilation: Codec.Compilations.Compilation,
contract: Codec.Compilations.Contract,
artifact?: Artifact
Function constructor
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
compilations: Compilations.Compilation[],
provider: Provider,
ensSettings?: DecoderTypes.EnsSettings,
selectorDirectory?: DecoderTypes.SelectorDirectorySettings
Function decodeTransactionBySelector
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async decodeTransactionBySelector(
transaction: DecoderTypes.Transaction,
data: Uint8Array, //this is redundant but included for convenience
additionalContexts: Contexts.Contexts,
context: Contexts.Context | null
Function file
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function file(options: RequireOptions) {
const sourceFilePath = path.resolve(options.file);
expectOptions(options, ["file"]);
File index.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const debug = require("debug")("compile-vyper");
const path = require("path");
const exec = require("child_process").exec;
const fs = require("fs");
const colors = require("colors");
Function printInstruction
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
printInstruction(locations = this.locationPrintouts) {
const instruction = this.session.view(sourcemapping.current.instruction);
const instructions = this.session.view(sourcemapping.current.instructions);
const step = this.session.view(trace.step);
const traceIndex = this.session.view(trace.index);
Function editedLines
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const editedLines = source.contents.split("\n").map((line, index) => {
if (line.length === 0) {
return line;
}
const { start, end } = sourceRange;
File index.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import debugModule from "debug";
const debug = debugModule("debugger:txlog:selectors");
import { createSelectorTree, createLeaf } from "reselect-tree";
ContractInstanceDecoder
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class ContractInstanceDecoder {
private providerAdapter: ProviderAdapter;
private compilation: Compilations.Compilation;
private contract: Compilations.Contract;
Function callstack
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function callstack(state = [], action) {
let newFrame;
switch (action.type) {
case actions.JUMP_IN:
const {
Function processTarget
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function processTarget(target, cwd, logger) {
const usesPath = target.path != undefined;
const usesCommand = target.command != undefined;
const usesStdin = target.stdin || target.stdin == undefined; // default true
const usesProperties = target.properties || target.fileProperties;
Function sourceFromLocal
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function sourceFromLocal(contractNameOrAddress, config) {
if (
contractNameOrAddress.startsWith("0x") &&
!web3Utils.isAddress(contractNameOrAddress)
) {
Function constructor
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
contract: Compilations.Contract,
compilation: Compilations.Compilation,
projectDecoder: ProjectDecoder,
artifact?: Artifact