trufflesuite/truffle

View on GitHub
packages/core/lib/debug/printer.js

Summary

Maintainability
F
1 wk
Test Coverage

File printer.js has 726 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const debugModule = require("debug");
const debug = debugModule("lib:debug:printer");

const path = require("path");
const util = require("util");
Severity: Major
Found in packages/core/lib/debug/printer.js - About 1 day to fix

    Function printReturnValue has 154 lines of code (exceeds 25 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,
    Severity: Major
    Found in packages/core/lib/debug/printer.js - About 6 hrs to fix

      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,
      Severity: Minor
      Found in packages/core/lib/debug/printer.js - About 5 hrs 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 printRevertMessage has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async printRevertMessage() {
          this.config.logger.log(
            DebugUtils.truffleColors.red("Transaction halted with a RUNTIME ERROR.")
          );
          this.config.logger.log("");
      Severity: Major
      Found in packages/core/lib/debug/printer.js - About 3 hrs to fix

        DebugPrinter has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class DebugPrinter {
          constructor(config, session) {
            this.config = config;
            this.session = session;
            this.select = expr => {
        Severity: Minor
        Found in packages/core/lib/debug/printer.js - About 2 hrs to fix

          Function printInstruction has 63 lines of code (exceeds 25 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: Major
          Found in packages/core/lib/debug/printer.js - About 2 hrs to fix

            Function evalAndPrintExpression has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async evalAndPrintExpression(raw, indent, suppress) {
                let variables = await this.session.variables({ indicateUnknown: true });
            
                //if we're just dealing with a single variable, handle that case
                //separately (so that we can do things in a better way for that
            Severity: Major
            Found in packages/core/lib/debug/printer.js - About 2 hrs to fix

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

                  printEvents() {
                    const instances = this.session.view(session.info.affectedInstances); //used to look
                    const formatAddress = address => {
                      const name = instances[address]?.contractName;
                      const colorizedAddress = colors.yellow(address); //dull yellow
                Severity: Minor
                Found in packages/core/lib/debug/printer.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 printRevertMessage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                      async printRevertMessage() {
                        this.config.logger.log(
                          DebugUtils.truffleColors.red("Transaction halted with a RUNTIME ERROR.")
                        );
                        this.config.logger.log("");
                    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 printEvents has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                      printEvents() {
                        const instances = this.session.view(session.info.affectedInstances); //used to look
                        const formatAddress = address => {
                          const name = instances[address]?.contractName;
                          const colorizedAddress = colors.yellow(address); //dull yellow
                    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 constructor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      constructor(config, session) {
                        this.config = config;
                        this.session = session;
                        this.select = expr => {
                          let selector, result;
                    Severity: Minor
                    Found in packages/core/lib/debug/printer.js - About 1 hr to fix

                      Function safelyEvaluateWithSelectors has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        safelyEvaluateWithSelectors(expression, context) {
                          const select = this.select;
                          let interpreter;
                          interpreter = new Interpreter(expression, function (
                            interpreter,
                      Severity: Minor
                      Found in packages/core/lib/debug/printer.js - About 1 hr to fix

                        Function evalAndPrintExpression has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                          async evalAndPrintExpression(raw, indent, suppress) {
                            let variables = await this.session.variables({ indicateUnknown: true });
                        
                            //if we're just dealing with a single variable, handle that case
                            //separately (so that we can do things in a better way for that
                        Severity: Minor
                        Found in packages/core/lib/debug/printer.js - About 55 mins 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

                        Avoid deeply nested control flow statements.
                        Open

                              if (name) {
                                //case 12a: it has a name
                                this.config.logger.log("Returned values:");
                                this.config.logger.log(`${name}: ${prettyData}`);
                              } else {
                        Severity: Major
                        Found in packages/core/lib/debug/printer.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                  for (let index = 0; index < values.length; index++) {
                                    const { value } = values[index];
                                    const prefix = paddedPrefixes[index];
                                    const formatted = DebugUtils.formatValue(value, maxLength);
                                    this.config.logger.log(prefix + formatted);
                          Severity: Major
                          Found in packages/core/lib/debug/printer.js - About 45 mins to fix

                            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

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

                                if (!allocationFound && decodings.length === 0) {
                                  //case 1: no allocation found, decoding failed
                                  this.config.logger.log("");
                                  this.config.logger.log(
                                    "A value was returned but it could not be decoded."
                            Severity: Major
                            Found in packages/core/lib/debug/printer.js and 3 other locations - About 1 hr to fix
                            packages/core/lib/debug/printer.js on lines 481..649
                            packages/core/lib/debug/printer.js on lines 496..649
                            packages/core/lib/debug/printer.js on lines 501..649

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

                            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

                                } else if (decodings[0].kind === "unknownbytecode") {
                                  //case 6: unknown bytecode
                                  this.config.logger.log("");
                                  this.config.logger.log(
                                    "Bytecode was returned, but it could not be identified."
                            Severity: Major
                            Found in packages/core/lib/debug/printer.js and 3 other locations - About 1 hr to fix
                            packages/core/lib/debug/printer.js on lines 470..649
                            packages/core/lib/debug/printer.js on lines 481..649
                            packages/core/lib/debug/printer.js on lines 496..649

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

                            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

                                } else if (allocationFound && decodings.length === 0) {
                                  //case 3: allocation found but decoding failed
                                  this.config.logger.log("");
                                  this.config.logger.log("The return value could not be decoded.");
                                  this.config.logger.log("");
                            Severity: Major
                            Found in packages/core/lib/debug/printer.js and 3 other locations - About 1 hr to fix
                            packages/core/lib/debug/printer.js on lines 470..649
                            packages/core/lib/debug/printer.js on lines 496..649
                            packages/core/lib/debug/printer.js on lines 501..649

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

                            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

                                } else if (decodings[0].kind === "failure") {
                                  //case 5: revert (no message)
                                  this.config.logger.log("");
                                  this.config.logger.log("There was no revert message.");
                                  this.config.logger.log("");
                            Severity: Major
                            Found in packages/core/lib/debug/printer.js and 3 other locations - About 1 hr to fix
                            packages/core/lib/debug/printer.js on lines 470..649
                            packages/core/lib/debug/printer.js on lines 481..649
                            packages/core/lib/debug/printer.js on lines 501..649

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

                            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

                                const sourceNames = Object.assign(
                                  //note: only include user sources
                                  {},
                                  ...Object.entries(sources).map(([id, source]) => ({
                                    [id]: path.basename(source.sourcePath)
                            Severity: Major
                            Found in packages/core/lib/debug/printer.js and 1 other location - About 1 hr to fix
                            packages/core/lib/debug/interpreter.js on lines 253..259

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

                            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("sto")) {
                                  this.config.logger.log(DebugUtils.formatStorage(storage));
                                  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 247..250

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

                            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("cal")) {
                                  this.config.logger.log(DebugUtils.formatCalldata(calldata));
                                  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 243..246

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

                            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

                                    this.config.logger.log(
                                      util.inspect(
                                        new Codec.Export.ReturndataDecodingInspector(decodings[0], {
                                          noHideAddress: true
                                        }),
                            Severity: Minor
                            Found in packages/core/lib/debug/printer.js and 1 other location - About 55 mins to fix
                            packages/core/lib/debug/printer.js on lines 518..525

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

                            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

                                  this.config.logger.log(
                                    util.inspect(
                                      new Codec.Export.ReturndataDecodingInspector(decodings[0], {
                                        noHideAddress: true
                                      }),
                            Severity: Minor
                            Found in packages/core/lib/debug/printer.js and 1 other location - About 55 mins to fix
                            packages/core/lib/debug/printer.js on lines 581..588

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

                            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

                                } else if (
                                  decodings[0].kind === "revert" &&
                                  decodings.filter(decoding => decoding.kind === "revert").length === 1
                                ) {
                                  //case 9: revert (with message) (unambiguous)
                            Severity: Minor
                            Found in packages/core/lib/debug/printer.js and 1 other location - About 35 mins to fix
                            packages/core/lib/debug/printer.js on lines 568..649

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

                            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

                                } else if (
                                  decodings[0].kind === "revert" &&
                                  decodings.filter(decoding => decoding.kind === "revert").length > 1
                                ) {
                                  //case 10: ambiguous revert with message
                            Severity: Minor
                            Found in packages/core/lib/debug/printer.js and 1 other location - About 35 mins to fix
                            packages/core/lib/debug/printer.js on lines 527..649

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

                            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

                            There are no issues that match your filters.

                            Category
                            Status