trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

  transactionHash: {
    get: function () {
      return this.network.transactionHash;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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

  db: {
    get: function () {
      return this._json.db;
    },
    set: function (db) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403

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

function txIndex(state = null, action) {
  switch (action.type) {
    case actions.SAVE_TX_IDENTIFICATION:
      return action.txIndex;
    case actions.UNLOAD_TRANSACTION:
Severity: Major
Found in packages/debugger/lib/evm/reducers.js and 2 other locations - About 55 mins to fix
packages/debugger/lib/evm/reducers.js on lines 90..99
packages/debugger/lib/evm/reducers.js on lines 117..126

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

function status(state = null, action) {
  switch (action.type) {
    case actions.SAVE_STATUS:
      return action.status;
    case actions.UNLOAD_TRANSACTION:
Severity: Major
Found in packages/debugger/lib/evm/reducers.js and 2 other locations - About 55 mins to fix
packages/debugger/lib/evm/reducers.js on lines 90..99
packages/debugger/lib/evm/reducers.js on lines 101..110

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

const verbosePanicTable = {
  0x01: "An assert() check was not satisfied.",
  0x11: "An arithmetic overflow occurred outside an unchecked { ... } block.",
  0x12: "A division by zero occurred.",
  0x21: "An integer was cast to an enum type that cannot hold it.",
Severity: Minor
Found in packages/debug-utils/index.js and 1 other location - About 55 mins to fix
packages/debug-utils/index.js on lines 12..22

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

function blockHash(state = null, action) {
  switch (action.type) {
    case actions.SAVE_TX_IDENTIFICATION:
      return action.blockHash;
    case actions.UNLOAD_TRANSACTION:
Severity: Major
Found in packages/debugger/lib/evm/reducers.js and 2 other locations - About 55 mins to fix
packages/debugger/lib/evm/reducers.js on lines 101..110
packages/debugger/lib/evm/reducers.js on lines 117..126

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

const panicTable = {
  0x01: "Failed assertion",
  0x11: "Arithmetic overflow",
  0x12: "Division by zero",
  0x21: "Enum value out of bounds",
Severity: Minor
Found in packages/debug-utils/index.js and 1 other location - About 55 mins to fix
packages/debug-utils/index.js on lines 24..34

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

Function handleYulExit has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  sourceId,
  sourceIndex,
  node,
  pointer,
  base,
Severity: Major
Found in packages/debugger/lib/ast/sagas/index.js - About 50 mins to fix

    Function handleYulEnter has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      sourceId,
      sourceIndex,
      node,
      pointer,
      base,
    Severity: Major
    Found in packages/debugger/lib/ast/sagas/index.js - About 50 mins to fix

      Function yulWalk has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        sourceId,
        sourceIndex,
        node,
        pointer,
        base,
      Severity: Major
      Found in packages/debugger/lib/ast/sagas/index.js - About 50 mins to fix

        Function allocate has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          storage,
          memory,
          abi,
          calldata,
          returndata,
        Severity: Major
        Found in packages/debugger/lib/data/actions/index.js - About 50 mins to fix

          Function literalAssignments has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            compilationId,
            internalFor,
            node,
            stack,
            currentDepth,
          Severity: Major
          Found in packages/debugger/lib/data/sagas/index.js - About 50 mins to fix

            Function assignParameters has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              compilationId,
              internalFor,
              parameters,
              top,
              functionDepth,
            Severity: Major
            Found in packages/debugger/lib/data/sagas/index.js - About 50 mins to fix

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

                    yield put(
                      actions.mapPathAndAssign(
                        address,
                        slot,
                        assignments,
              Severity: Minor
              Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 50 mins to fix
              packages/debugger/lib/data/sagas/index.js on lines 617..625

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

              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

                      yield put(
                        actions.mapPathAndAssign(
                          address,
                          slot,
                          assignments,
              Severity: Minor
              Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 50 mins to fix
              packages/debugger/lib/data/sagas/index.js on lines 712..720

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

              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 logWeb3 = (logger = console) => {
                const web3Version = pkg.dependencies.web3;
                logger.log(`Web3.js v${web3Version}`);
              };
              Severity: Minor
              Found in packages/core/lib/version.js and 1 other location - About 50 mins to fix
              packages/core/lib/version.js on lines 63..66

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

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

              export const { FixedError } = createCodecComponent(
                "FixedError",
                (data: Format.Errors.FixedError) => <FixedPaddingError data={data} />
              );
              packages/codec-components/src/react/components/codec/format.errors.address-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.array-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.bytes-static-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.contract-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.int-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.string-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.struct-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.tuple-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.ufixed-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.uint-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error.tsx on lines 6..11

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

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

              export const { ArrayError } = createCodecComponent(
                "ArrayError",
                (data: Format.Errors.ArrayError) => (
                  <DynamicDataImplementationError data={data} />
                )
              packages/codec-components/src/react/components/codec/format.errors.address-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.bytes-dynamic-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.bytes-static-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.contract-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.fixed-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.int-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.string-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.struct-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.tuple-error.tsx on lines 6..11
              packages/codec-components/src/react/components/codec/format.errors.ufixed-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.uint-error.tsx on lines 6..9
              packages/codec-components/src/react/components/codec/format.errors.user-defined-value-type-error.tsx on lines 6..11

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

              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