trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

Function _ has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        (scopes, scope, pointer, sourceId, language) => {
          let variables = {};
          if (scope !== undefined) {
            let cur =
              scope.id !== undefined ? scope.id : makePath(sourceId, pointer);
Severity: Minor
Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

    Function execVyper has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function execVyper(options, sourcePath, version, callback) {
      const formats = ["abi", "bytecode", "bytecode_runtime"];
      debug("version: %s", version);
      if (
        semver.satisfies(version, ">=0.1.0-beta.7", {
    Severity: Minor
    Found in packages/compile-vyper/index.js - About 1 hr to fix

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

      module.exports = async function (options) {
        const TruffleError = require("@truffle/error");
        const WorkflowCompile = require("@truffle/workflow-compile").default;
        const Config = require("@truffle/config");
        const config = Config.detect(options);
      Severity: Minor
      Found in packages/core/lib/commands/compile/run.js - About 1 hr to fix

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

        module.exports = async function (selectedCommand, subCommand, options) {
          const commands = require("../index");
          const globalCommandOptions = require("../../global-command-options");
          const TruffleError = require("@truffle/error");
        
        
        Severity: Minor
        Found in packages/core/lib/commands/help/displayCommandHelp.js - About 1 hr to fix

          Function decodeReturnValueWithAdditionalContexts has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public async decodeReturnValueWithAdditionalContexts(
              abi: Abi.FunctionEntry,
              data: string,
              options: DecoderTypes.ReturnOptions = {},
              additionalContexts: Contexts.Contexts = {}
          Severity: Minor
          Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

            Function constructor has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(info: Types.EncoderInfoInternal) {
                //first, set up the basic info that we need to run
                if (info.userDefinedTypes && info.allocations) {
                  debug("internal route!");
                  this.userDefinedTypes = info.userDefinedTypes;
            Severity: Minor
            Found in packages/encoder/lib/encoders.ts - About 1 hr to fix

              Function decodeMessage has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export async function decodeMessage(
                lifecycle: ReceivedMessageLifecycle<DashboardProviderMessage>,
                decoder: ProjectDecoder
              ) {
                const method = lifecycle.message.payload.method as DecodableRpcMethod;
              Severity: Minor
              Found in packages/dashboard/src/utils/dash.ts - About 1 hr to fix

                Function handleCompilations has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    async (compilations: Compilation[], hashes?: string[]) => {
                      if (compilations.length === 0 || !stateRef.current.decoder) return;
                
                      let decoderNeedsUpdate = false;
                      const decoderCompilations = [...stateRef.current.decoderCompilations!];
                Severity: Minor
                Found in packages/dashboard/src/contexts/DashContext/DashProvider.tsx - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (
                            isContextChange ||
                            !node ||
                            node.id === undefined ||
                            !next ||
                  Severity: Critical
                  Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (
                          decoding.kind === "function" &&
                          (decoding.abi.name === "aggregate" ||
                            decoding.abi.name === "blockAndAggregate") &&
                          decoding.abi.inputs.length === 1 &&
                    Severity: Critical
                    Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          } else if (
                            decoding.kind === "function" &&
                            decoding.abi.name === "aggregate3" &&
                            decoding.abi.inputs.length === 1 &&
                            decoding.abi.inputs[0].type === "tuple[]" &&
                      Severity: Critical
                      Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

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

                          succeed(textOrOptions?: string | Partial<SpinnerOptions>): void {
                            if (!spinnies.pick(this.name)) {
                              return;
                            }
                            spinnies.succeed(this.name, textOrOptions);
                        Severity: Major
                        Found in packages/spinners/lib/spinner.ts and 3 other locations - About 1 hr to fix
                        packages/spinners/lib/spinner.ts on lines 59..64
                        packages/spinners/lib/spinner.ts on lines 83..88
                        packages/spinners/lib/spinner.ts on lines 95..100

                        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 68.

                        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 4 locations. Consider refactoring.
                        Open

                          fail(textOrOptions?: string | Partial<SpinnerOptions>): void {
                            if (!spinnies.pick(this.name)) {
                              return;
                            }
                            spinnies.fail(this.name, textOrOptions);
                        Severity: Major
                        Found in packages/spinners/lib/spinner.ts and 3 other locations - About 1 hr to fix
                        packages/spinners/lib/spinner.ts on lines 59..64
                        packages/spinners/lib/spinner.ts on lines 71..76
                        packages/spinners/lib/spinner.ts on lines 95..100

                        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 68.

                        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 4 locations. Consider refactoring.
                        Open

                          warn(textOrOptions?: string | Partial<SpinnerOptions>): void {
                            if (!spinnies.pick(this.name)) {
                              return;
                            }
                            spinnies.warn(this.name, textOrOptions);
                        Severity: Major
                        Found in packages/spinners/lib/spinner.ts and 3 other locations - About 1 hr to fix
                        packages/spinners/lib/spinner.ts on lines 59..64
                        packages/spinners/lib/spinner.ts on lines 71..76
                        packages/spinners/lib/spinner.ts on lines 83..88

                        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 68.

                        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 4 locations. Consider refactoring.
                        Open

                          stop(textOrOptions?: string | Partial<SpinnerOptions>): void {
                            if (!spinnies.pick(this.name)) {
                              return;
                            }
                            spinnies.stop(this.name, textOrOptions);
                        Severity: Major
                        Found in packages/spinners/lib/spinner.ts and 3 other locations - About 1 hr to fix
                        packages/spinners/lib/spinner.ts on lines 71..76
                        packages/spinners/lib/spinner.ts on lines 83..88
                        packages/spinners/lib/spinner.ts on lines 95..100

                        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 68.

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

                        function sources(state = DEFAULT_SOURCES, action) {
                          switch (action.type) {
                            /*
                             * Adding new sources
                             */
                        Severity: Minor
                        Found in packages/debugger/lib/sourcemapping/reducers.js - About 1 hr to fix

                          Function yulWalk has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function* yulWalk(
                            sourceId,
                            sourceIndex,
                            node,
                            pointer,
                          Severity: Minor
                          Found in packages/debugger/lib/ast/sagas/index.js - About 1 hr to fix

                            Function startDebugger has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              async startDebugger(compilations) {
                                const startMessage = DebugUtils.formatStartMessage(
                                  this.txHash !== undefined
                                );
                                const specifiedRegistry = this.config.noEns ? null : this.config.registry; //specified at the command line
                            Severity: Minor
                            Found in packages/core/lib/debug/cli.js - About 1 hr to fix

                              Function forAddress has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                public async forAddress(
                                  address: string,
                                  block: Codec.BlockSpecifier = "latest"
                                ): Promise<ContractInstanceEncoder> {
                                  //code duplication warning: this method is basically copypasted
                              Severity: Minor
                              Found in packages/encoder/lib/encoders.ts - About 1 hr to fix

                                Function resolve has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  async resolve(
                                    importPath: string,
                                    importedFrom: string = "",
                                    options: { compiler?: { name: string; version: string } } = {}
                                  ) {
                                Severity: Minor
                                Found in packages/resolver/lib/sources/abi.ts - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language