trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

export type MutationInput<
  C extends Collections,
  N extends CollectionName<C>
> = {
  [K in N]: Input<C, N>[];
Severity: Minor
Found in packages/db/src/meta/collections.ts and 1 other location - About 40 mins to fix
packages/db/src/meta/collections.ts on lines 142..147

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

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

export type MutationPayload<
  C extends Collections,
  N extends CollectionName<C>
> = {
  [K in N]: Resource<C, N>[];
Severity: Minor
Found in packages/db/src/meta/collections.ts and 1 other location - About 40 mins to fix
packages/db/src/meta/collections.ts on lines 135..140

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

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

  public async forContract(
    contract: Types.ContractConstructorObject
  ): Promise<ContractEncoder> {
    return await this.forArtifact(contract);
  }
Severity: Minor
Found in packages/encoder/lib/encoders.ts and 1 other location - About 40 mins to fix
packages/decoder/lib/decoders.ts on lines 393..397

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

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

export const { MappingError } = createCodecComponent(
  "MappingError",
  (_data: Format.Errors.MappingError) => {
    throw new ComponentDataTypeIsNeverError("Codec.Format.Errors.MappingError");
  }
packages/codec-components/src/react/components/codec/format.errors.magic-error.tsx on lines 5..10
packages/codec-components/src/react/components/codec/format.errors.options-error.tsx on lines 5..10
packages/codec-components/src/react/components/codec/format.errors.type-error-union.tsx on lines 5..12

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

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

  export const Fixed = () =>
    Numerics.Precision().map(([m, n]) => `fixed${m}x${n}`);
Severity: Minor
Found in packages/abi-utils/lib/arbitrary.ts and 1 other location - About 40 mins to fix
packages/abi-utils/lib/arbitrary.ts on lines 219..220

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

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 scope has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function scope(id, pointer, parentId, sourceIndex, sourceId) {
Severity: Minor
Found in packages/debugger/lib/data/actions/index.js - About 35 mins to fix

    Function mapPathAndAssign has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      address,
      slot,
      assignments,
      typeIdentifier,
      parentType
    Severity: Minor
    Found in packages/debugger/lib/data/actions/index.js - About 35 mins to fix

      Function findAncestorOfType has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function findAncestorOfType(node, types, scopes, pointer = null, root = null) {
      Severity: Minor
      Found in packages/debugger/lib/data/selectors/index.js - About 35 mins to fix

        Function store has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export function store(pointer, newPointer, step, rawSlot, rawValue) {
        Severity: Minor
        Found in packages/debugger/lib/txlog/actions/index.js - About 35 mins to fix

          Function externalReturn has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            pointer,
            newPointer,
            step,
            decodings,
            returnData
          Severity: Minor
          Found in packages/debugger/lib/txlog/actions/index.js - About 35 mins to fix

            Function walk has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function* walk(sourceId, sourceIndex, node, pointer = "", parentId = null) {
            Severity: Minor
            Found in packages/debugger/lib/ast/sagas/index.js - About 35 mins to fix

              Function handleYul has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function* handleYul(sourceId, sourceIndex, node, pointer, parentId) {
              Severity: Minor
              Found in packages/debugger/lib/ast/sagas/index.js - About 35 mins to fix

                Function jumpIn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  location,
                  functionNode,
                  contractNode,
                  sourceIsInternal,
                  sourceIsGenerated
                Severity: Minor
                Found in packages/debugger/lib/stacktrace/actions/index.js - About 35 mins to fix

                  Function scope has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  export function* scope(nodeId, pointer, parentId, sourceIndex, sourceId) {
                  Severity: Minor
                  Found in packages/debugger/lib/data/sagas/index.js - About 35 mins to fix

                    Function addAffectedInstance has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      address,
                      context,
                      binary,
                      creationBinary,
                      creationContext
                    Severity: Minor
                    Found in packages/debugger/lib/evm/actions/index.js - About 35 mins to fix

                      Function configureStore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        reducer,
                        saga,
                        sagaArgs,
                        initialState,
                        composeEnhancers
                      Severity: Minor
                      Found in packages/debugger/lib/store/common.js - About 35 mins to fix

                        Function yulDeclare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          node,
                          pointer,
                          scopePointer,
                          sourceIndex,
                          sourceId
                        Severity: Minor
                        Found in packages/debugger/lib/data/sagas/index.js - About 35 mins to fix

                          Function handleEnter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function* handleEnter(sourceId, sourceIndex, node, pointer, parentId) {
                          Severity: Minor
                          Found in packages/debugger/lib/ast/sagas/index.js - About 35 mins to fix

                            Function call has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            export function call(address, data, storageAddress, sender, value) {
                            Severity: Minor
                            Found in packages/debugger/lib/evm/actions/index.js - About 35 mins to fix

                              Function logEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              export function logEvent(pointer, newPointer, step, decoding, rawEventInfo) {
                              Severity: Minor
                              Found in packages/debugger/lib/txlog/actions/index.js - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language