trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

Function fetchExternalSources has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async fetchExternalSources(bugger) {
    const fetchSpinner = new Spinner(
      "core:debug:cli:fetch",
      "Getting and compiling external sources..."
    );
Severity: Minor
Found in packages/core/lib/debug/cli.js - About 1 hr to fix

    Function request has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private async request({
        method,
        params,
        formatOutput
      }: SendRequestArgs): Promise<any> {
    Severity: Minor
    Found in packages/encoder/lib/adapter.ts - About 1 hr to fix

      Function interpretTryAggregate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private async interpretTryAggregate(
          decoding: Codec.CalldataDecoding,
          transaction: DecoderTypes.Transaction,
          additionalContexts: Contexts.Contexts = {},
          additionalAllocations?: {
      Severity: Minor
      Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

        Function getTruffleDashboardUserConfig has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function getTruffleDashboardUserConfig(
          config: HardhatConfig,
          userConfig: HardhatUserConfig
        ) {
          const {
        Severity: Minor
        Found in packages/dashboard-hardhat-plugin/src/index.ts - About 1 hr to fix

          Function readAndParseArtifactFiles has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function readAndParseArtifactFiles(
            paths: string[],
            contracts_build_directory: string
          ): SourceFilesArtifacts {
            const sourceFilesArtifacts: SourceFilesArtifacts = {};
          Severity: Minor
          Found in packages/profiler/src/updated.ts - About 1 hr to fix

            Function requiredSources has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async requiredSources(options: any) {
                expect.options(options, [
                  "paths",
                  "base_path",
                  "resolver",
            Severity: Minor
            Found in packages/profiler/src/index.ts - About 1 hr to fix

              Function fetchSourcesForAddressAndMatchType has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private async fetchSourcesForAddressAndMatchType(
                  address: string,
                  matchType: "full" | "partial"
                ): Promise<Types.SourceInfo | null> {
                  const metadata = await this.getMetadata(address, matchType);
              Severity: Minor
              Found in packages/source-fetcher/lib/sourcify.ts - About 1 hr to fix

                Function instantExternalCall has 12 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  pointer,
                  newPointer, //does not actually affect the current pointer!
                  step,
                  address,
                  context,
                Severity: Major
                Found in packages/debugger/lib/txlog/actions/index.js - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if (locations.has("sta")) {
                        this.config.logger.log(DebugUtils.formatStack(step.stack));
                        this.config.logger.log("");
                      }
                  Severity: Major
                  Found in packages/core/lib/debug/printer.js and 1 other location - About 1 hr to fix
                  packages/core/lib/debug/printer.js on lines 251..254

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 65.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if (locations.has("mem")) {
                        this.config.logger.log(DebugUtils.formatMemory(step.memory));
                        this.config.logger.log("");
                      }
                  Severity: Major
                  Found in packages/core/lib/debug/printer.js and 1 other location - About 1 hr to fix
                  packages/core/lib/debug/printer.js on lines 255..258

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 65.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                        options: {
                          language: "Solidity",
                          version: result.CompilerVersion,
                          settings: this.extractSettings(result),
                          specializations: {
                  Severity: Major
                  Found in packages/source-fetcher/lib/etherscan.ts and 1 other location - About 1 hr to fix
                  packages/source-fetcher/lib/etherscan.ts on lines 226..234

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 65.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                        options: {
                          language: "Solidity",
                          version: result.CompilerVersion,
                          settings: this.extractSettings(result),
                          specializations: {
                  Severity: Major
                  Found in packages/source-fetcher/lib/etherscan.ts and 1 other location - About 1 hr to fix
                  packages/source-fetcher/lib/etherscan.ts on lines 245..253

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 65.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function sections has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          (definitions, refs, scopes) => {
                            let sections = {
                              builtin: [],
                              global: [],
                              contract: [],
                  Severity: Minor
                  Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

                    Function runSpawn has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      async runSpawn(inputStrings, options) {
                        let childPath;
                        /* eslint-disable no-undef */
                        if (typeof BUNDLE_CONSOLE_CHILD_FILENAME !== "undefined") {
                          childPath = path.join(__dirname, BUNDLE_CONSOLE_CHILD_FILENAME);
                    Severity: Minor
                    Found in packages/core/lib/console.js - About 1 hr to fix

                      Function printVariables has 37 lines of code (exceeds 25 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

                        Function collectBlocks has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          static async collectBlocks(options: {
                            run: Process.ProcessorRunner;
                            network: Pick<Input<"networks">, "name" | "networkId">;
                            blocks: (DataModel.Block | undefined)[];
                            settings?: {
                        Severity: Minor
                        Found in packages/db/src/network/index.ts - About 1 hr to fix

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            return {
                              trace,
                              address,
                              binary,
                              data,
                          Severity: Major
                          Found in packages/debugger/lib/web3/sagas/index.js and 1 other location - About 1 hr to fix
                          packages/debugger/lib/txlog/actions/index.js on lines 44..57

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            return {
                              type: EXTERNAL_CALL,
                              pointer,
                              newPointer,
                              step,
                          Severity: Major
                          Found in packages/debugger/lib/txlog/actions/index.js and 1 other location - About 1 hr to fix
                          packages/debugger/lib/web3/sagas/index.js on lines 166..179

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                              | {
                                  callBytecode?: {
                                    linkReferences: { name: string | null }[] | null;
                                  };
                                  createBytecode?: {
                          Severity: Major
                          Found in packages/db/src/project/loadMigrate/contracts.ts and 1 other location - About 1 hr to fix
                          packages/db/src/project/loadMigrate/contracts.ts on lines 21..28

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                            produces: {
                              callBytecode?: {
                                linkReferences: { name: string | null }[] | null;
                              };
                              createBytecode?: {
                          Severity: Major
                          Found in packages/db/src/project/loadMigrate/contracts.ts and 1 other location - About 1 hr to fix
                          packages/db/src/project/loadMigrate/contracts.ts on lines 31..38

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language