trufflesuite/truffle

View on GitHub

Showing 685 of 1,401 total issues

Function setOrClearBreakpointObject has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async setOrClearBreakpointObject(breakpoint, setOrClear) {
    const existingBreakpoints = this.session.view(controller.breakpoints);
    //OK, we've constructed the breakpoint!  But if we're adding, we'll
    //want to adjust to make sure we don't set it on an empty line or
    //anything like that
Severity: Minor
Found in packages/core/lib/debug/interpreter.js - About 1 hr to fix

    Function merge has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      merge({ outputs, breadcrumb, output }) {
        const { compilationIndex, sourcePointer } = breadcrumb;
    
        const compilationsBefore = outputs.slice(0, compilationIndex);
        const compilation = outputs[compilationIndex];
    Severity: Minor
    Found in packages/db/src/project/loadCompile/sources.ts - About 1 hr to fix

      Function findPossibleNetworks has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const findPossibleNetworks = async (options: {
          network: Resource<"networks">;
          limit: number;
          alreadyTried: string[];
          workspace: Workspace;
      Severity: Minor
      Found in packages/db/src/resources/networks/resolvePossibleRelations.ts - About 1 hr to fix

        Function ConfirmChain has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ConfirmChain(): JSX.Element {
          const {
            state: { chainInfo },
            operations: { toggleNotice }
          } = useDash()!;

          Function Stack has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Stack(): JSX.Element | null {
            const { classes } = useStyles();
            const {
              state: {
                debugger: { session }
          Severity: Minor
          Found in packages/dashboard/src/components/composed/Debugger/Stack.tsx - About 1 hr to fix

            Function decodeLog has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function* decodeLog() {
              const userDefinedTypes = yield select(data.views.userDefinedTypes);
              const state = yield select(data.current.state); //note: this includes the data to be decoded!
              const allocations = yield select(data.info.allocations);
              const contexts = yield select(data.views.contexts);
            Severity: Minor
            Found in packages/debugger/lib/data/sagas/index.js - About 1 hr to fix

              Function fromBuildInfo has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                export const fromBuildInfo = (
                  buildInfo: Hardhat.BuildInfo
                ): CompiledContract[] => {
                  const contracts = [];
                  for (const [sourcePath, sourceContracts] of Object.entries(
              Severity: Minor
              Found in packages/from-hardhat/src/compilation.ts - About 1 hr to fix

                Function Layout has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Layout(): JSX.Element {
                  const {
                    state: { notice, analyticsConfig },
                    operations: { updateAnalyticsConfig }
                  } = useDash()!;
                Severity: Minor
                Found in packages/dashboard/src/components/composed/Layout.tsx - About 1 hr to fix

                  Function start has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                    start: async function (context, web3Error) {
                      const constructor = this;
                      let currentBlock = override.defaultMaxBlocks;
                  
                      // Reject after attempting to get reason string if we shouldn't be waiting.
                  Severity: Minor
                  Found in packages/contract/lib/override.js - About 1 hr to fix

                  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 processDeploymentError has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                    async processDeploymentError(data) {
                      const error = data.estimateError || data.error;
                  
                      data.reason = data.error ? data.error.reason : null;
                  
                  
                  Severity: Minor
                  Found in packages/events/defaultSubscribers/migrate/Reporter.js - About 1 hr to fix

                  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 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports = fn => {
                    // Add our static methods
                    // Add something here about excluding send, privately defined methods
                    Object.keys(fn._constructorMethods).forEach(function (key) {
                      fn[key] = fn._constructorMethods[key].bind(fn);
                  Severity: Minor
                  Found in packages/contract/lib/contract/bootstrap.js - About 1 hr to fix

                  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 printInstruction has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  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);
                  Severity: Minor
                  Found in packages/core/lib/debug/printer.js - About 1 hr to fix

                  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 printVariables has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                    async printVariables(sectionOuts = this.sectionPrintouts) {
                      const values = await this.session.variables();
                      const sections = this.session.view(data.current.identifiers.sections);
                  
                      const sectionNames = {
                  Severity: Minor
                  Found in packages/core/lib/debug/printer.js - About 1 hr to fix

                  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 flattedEvents has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      flattedEvents: createLeaf(["./transactionLog"], log => {
                        const returnStatus = node => {
                          switch (node.returnKind) {
                            case "revert":
                              return false;
                  Severity: Minor
                  Found in packages/debugger/lib/txlog/selectors/index.js - About 1 hr to fix

                    Function scopes has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function scopes(state = DEFAULT_SCOPES, action) {
                      switch (action.type) {
                        case actions.SCOPE: {
                          const { sourceId, id, sourceIndex, parentId, pointer } = action;
                          const astRef = id !== undefined ? id : makePath(sourceIndex, pointer);
                    Severity: Minor
                    Found in packages/debugger/lib/data/reducers.js - About 1 hr to fix

                      Function rejectHijacker has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function rejectHijacker(e) {
                          debug("hijacking!");
                          debug("hash: %s", this.txHash);
                          let getSolidityStackTrace;
                          if (bugger && this.txHash) {
                      Severity: Minor
                      Found in packages/contract/lib/promievent.js - About 1 hr to fix

                        Function exports has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = async function (options) {
                          const Config = require("@truffle/config");
                          const OS = require("os");
                        
                          const log = options.logger
                        Severity: Minor
                        Found in packages/core/lib/commands/config/run.js - About 1 hr to fix

                          Function printState has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            printState(
                              contextBefore = 2,
                              contextAfter = 0,
                              location = this.session.view(controller.current.location)
                            ) {
                          Severity: Minor
                          Found in packages/core/lib/debug/printer.js - About 1 hr to fix

                            Function process has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function* process<
                              Network extends Pick<Resource<"networks">, "id" | keyof Input<"networks">>
                            >(options: { network: IdObject<"networks"> }): Process<Network | undefined> {
                              const {
                                network: { id }
                            Severity: Minor
                            Found in packages/db/src/network/fetch/knownLatest.ts - About 1 hr to fix

                              Function createMultistepSelectors has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function createMultistepSelectors(stepSelector) {
                                return {
                                  /**
                                   * .instruction
                                   */
                              Severity: Minor
                              Found in packages/debugger/lib/sourcemapping/selectors/index.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language