trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

export const { UfixedPaddingError } = createCodecComponent(
  "UfixedPaddingError",
  ({ kind, raw }: Format.Errors.UfixedPaddingError) => (
    <CodecError kind={kind}>{raw}</CodecError>
  )
packages/codec-components/src/react/components/codec/format.errors.address-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.bool-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.bytes-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.contract-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.enum-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.fixed-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.function-external-non-stack-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.function-external-stack-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.function-internal-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.indexed-reference-type-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.int-padding-error.tsx on lines 6..11
packages/codec-components/src/react/components/codec/format.errors.uint-padding-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 70.

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

const deriveConfigEnvironment = function (detectedConfig, network, url) {
  let configuredNetwork;

  const configDefinesProvider =
    detectedConfig.networks[network] &&
Severity: Minor
Found in packages/core/lib/command-utils.js - About 1 hr to fix

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

    module.exports = async function (options) {
      const Config = require("@truffle/config");
      const ConfigurationError = require("../../errors/configurationerror");
      const create = require("./helpers");
    
    
    Severity: Minor
    Found in packages/core/lib/commands/create/run.js - About 1 hr to fix

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

      module.exports = async options => {
        const TruffleError = require("@truffle/error");
        const { Plugins } = require("@truffle/plugins");
        const { getConfig, constructRecipes } = require("./plugins");
        const { preserve, ConsoleReporter } = require("@truffle/preserve");
      Severity: Minor
      Found in packages/core/lib/commands/preserve/run.js - About 1 hr to fix

        Function process has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function* process(options: {
          relationship: "ancestor" | "descendant";
          network: IdObject<"networks">;
          alreadyTried: string[];
          disableIndex?: boolean;
        Severity: Minor
        Found in packages/db/src/network/query/nextPossiblyRelatedNetworks.ts - About 1 hr to fix

          Function forAttachAndSchema has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const forAttachAndSchema = <C extends Collections>(options: {
            attach: (options: Pouch.Adapters.AttachOptions) => Workspace<C>;
            schema: GraphQLSchema;
          }) => {
            const { attach, schema } = options;
          Severity: Minor
          Found in packages/db/src/meta/interface.ts - About 1 hr to fix

            Function readStorage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function* readStorage(
              pointer: Pointer.StoragePointer,
              state: Evm.EvmState
            ): Generator<DecoderRequest, Uint8Array, Uint8Array | null> {
              const { storage } = state;
            Severity: Minor
            Found in packages/codec/lib/storage/read/index.ts - About 1 hr to fix

              Function forContract has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function forContract(contract: any): CompiledContract {
                const {
                  contractName,
                  contract_name,
                  sourcePath,
              Severity: Minor
              Found in packages/compile-common/src/shims/LegacyToNew.ts - About 1 hr to fix

                Function decodeDispatch has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function* decodeDispatch(
                  dataType: Format.Types.Type,
                  pointer: Pointer.DataPointer,
                  info: Evm.EvmInfo,
                  options: DecoderOptions = {}
                Severity: Minor
                Found in packages/codec/lib/decode.ts - About 1 hr to fix

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

                    if (options.url && options.network) {
                      const message =
                        "" +
                        "Mutually exclusive options, --url and --network detected!" +
                        OS.EOL +
                  Severity: Major
                  Found in packages/core/lib/commands/call/run.js and 2 other locations - About 1 hr to fix
                  packages/core/lib/commands/console/run.js on lines 8..18
                  packages/core/lib/commands/debug/run.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 69.

                  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

                    if (options.url && options.network) {
                      const message =
                        "" +
                        "Mutually exclusive options, --url and --network detected!" +
                        OS.EOL +
                  Severity: Major
                  Found in packages/core/lib/commands/console/run.js and 2 other locations - About 1 hr to fix
                  packages/core/lib/commands/call/run.js on lines 16..26
                  packages/core/lib/commands/debug/run.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 69.

                  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

                    if (options.url && options.network) {
                      const message =
                        "" +
                        "Mutually exclusive options, --url and --network detected!" +
                        OS.EOL +
                  Severity: Major
                  Found in packages/core/lib/commands/debug/run.js and 2 other locations - About 1 hr to fix
                  packages/core/lib/commands/call/run.js on lines 16..26
                  packages/core/lib/commands/console/run.js on lines 8..18

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

                  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 interface UintValue {
                    type: Types.UintType;
                    kind: "value";
                    value: {
                      asBN: BN;
                  Severity: Major
                  Found in packages/codec/lib/format/elementary.ts and 3 other locations - About 1 hr to fix
                  packages/codec/lib/format/elementary.ts on lines 61..69
                  packages/codec/lib/format/elementary.ts on lines 191..199
                  packages/codec/lib/format/elementary.ts on lines 206..214

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

                  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 { EmptyFailureDecoding } = createCodecComponent(
                    "EmptyFailureDecoding",
                    (_data: Codec.EmptyFailureDecoding) => (
                      <Code type="revert-keyword">
                        revert<Code type="bracket">()</Code>
                  packages/codec-components/src/react/components/codec/self-destruct-decoding.tsx on lines 6..13

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

                  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

                        <Text>
                          <Text bold>address: </Text>
                          {address ? (
                            <Text>{address}</Text>
                          ) : (
                  Severity: Major
                  Found in packages/db-kit/src/cli/decodeAddress/Inputs.tsx and 1 other location - About 1 hr to fix
                  packages/db-kit/src/cli/decodeTransaction/Inputs.tsx on lines 67..77

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

                  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 { SelfDestructDecoding } = createCodecComponent(
                    "SelfDestructDecoding",
                    (_data: Codec.SelfDestructDecoding) => (
                      <Code type="function">
                        selfdestruct<Code type="bracket">()</Code>
                  packages/codec-components/src/react/components/codec/empty-failure-decoding.tsx on lines 6..13

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

                  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

                        <Text>
                          <Text bold>tx hash: </Text>
                          {transactionHash ? (
                            <Text>{transactionHash}</Text>
                          ) : (
                  Severity: Major
                  Found in packages/db-kit/src/cli/decodeTransaction/Inputs.tsx and 1 other location - About 1 hr to fix
                  packages/db-kit/src/cli/decodeAddress/Inputs.tsx on lines 25..32

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

                  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 interface IntValue {
                    type: Types.IntType;
                    kind: "value";
                    value: {
                      asBN: BN;
                  Severity: Major
                  Found in packages/codec/lib/format/elementary.ts and 3 other locations - About 1 hr to fix
                  packages/codec/lib/format/elementary.ts on lines 46..54
                  packages/codec/lib/format/elementary.ts on lines 191..199
                  packages/codec/lib/format/elementary.ts on lines 206..214

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

                  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 interface FixedValue {
                    type: Types.FixedType;
                    kind: "value";
                    value: {
                      asBig: Big;
                  Severity: Major
                  Found in packages/codec/lib/format/elementary.ts and 3 other locations - About 1 hr to fix
                  packages/codec/lib/format/elementary.ts on lines 46..54
                  packages/codec/lib/format/elementary.ts on lines 61..69
                  packages/codec/lib/format/elementary.ts on lines 206..214

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

                  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 interface UfixedValue {
                    type: Types.UfixedType;
                    kind: "value";
                    value: {
                      asBig: Big;
                  Severity: Major
                  Found in packages/codec/lib/format/elementary.ts and 3 other locations - About 1 hr to fix
                  packages/codec/lib/format/elementary.ts on lines 46..54
                  packages/codec/lib/format/elementary.ts on lines 61..69
                  packages/codec/lib/format/elementary.ts on lines 191..199

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

                  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