trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

      callBytecode: {
        resolve: async ({ callBytecode }, _, { workspace }) => {
          debug("Resolving Contract.callBytecode...");

          if (!callBytecode) {
Severity: Major
Found in packages/db/src/resources/contracts.ts and 2 other locations - About 2 hrs to fix
packages/db/src/resources/contracts.ts on lines 163..178
packages/db/src/resources/nameRecords.ts on lines 49..64

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

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

  async resolve(
    importModule: string,
    importedFrom: string,
    options: { compiler?: { name: string } } = {}
  ) {
Severity: Major
Found in packages/resolver/lib/sources/vyper.ts - About 2 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

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

        breakpointsContainer: {
          overflow: "hidden",
          height: "30%",
          borderWidth: 1,
          borderStyle: "solid",
      packages/dashboard/src/components/composed/Debugger/Variables.tsx on lines 23..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 88.

      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

        variablesContainer: {
          overflow: "hidden",
          height: "40%",
          borderWidth: 1,
          borderStyle: "solid",
      packages/dashboard/src/components/composed/Debugger/Breakpoints/index.tsx on lines 9..20

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

      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 normalizeAsyncIterable = (
        content: AsyncIterable<Common.Sources.Contents.Bytes>
      ): Normalized.Sources.Content => {
        return (async function* () {
          for await (const bytes of content) {
      Severity: Major
      Found in packages/preserve/lib/targets/utils/normalize.ts and 1 other location - About 2 hrs to fix
      packages/preserve/lib/targets/utils/normalize.ts on lines 93..101

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

      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 normalizeIterable = (
        content: Iterable<Common.Sources.Contents.Bytes>
      ): Normalized.Sources.Content => {
        return (async function* () {
          for (const bytes of content) {
      Severity: Major
      Found in packages/preserve/lib/targets/utils/normalize.ts and 1 other location - About 2 hrs to fix
      packages/preserve/lib/targets/utils/normalize.ts on lines 103..111

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

      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

      File index.ts has 277 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import WebSocket from "isomorphic-ws";
      
      // must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
      import "../polyfill";
      import axios from "axios";
      Severity: Minor
      Found in packages/dashboard-message-bus-client/lib/connection/index.ts - About 2 hrs to fix

        Function get has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              get() {
                let networkConfig;
                try {
                  networkConfig = configObject.network_config;
                } catch {
        Severity: Major
        Found in packages/config/src/configDefaults.ts - About 2 hrs to fix

          File index.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import debugModule from "debug";
          const debug = debugModule("debugger:sourcemapping:selectors");
          
          import { createSelectorTree, createLeaf } from "reselect-tree";
          import SourceMapUtils from "@truffle/source-map-utils";
          Severity: Minor
          Found in packages/debugger/lib/sourcemapping/selectors/index.js - About 2 hrs to fix

            File index.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import debugModule from "debug";
            const debug = debugModule("debugger:web3:sagas");
            
            import {
              all,
            Severity: Minor
            Found in packages/debugger/lib/web3/sagas/index.js - About 2 hrs to fix

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

                  "migrate:runMigrations:start": [
                    async function ({ dryRun, migrations }) {
                      if (this.config.quiet) return;
                      const message = this.reporter.messages.steps("preAllMigrations", {
                        migrations,
              Severity: Major
              Found in packages/events/defaultSubscribers/migrate/index.js and 1 other location - About 2 hrs to fix
              packages/events/defaultSubscribers/migrate/index.js on lines 28..37

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

              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 [
                isElementaryValue,
                isElementaryErrorResult,
                isElementaryResult,
                elementaryGuards
              packages/codec-components/src/utils/type-guards/value-and-result/abi.ts on lines 15..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 87.

              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

                  "migrate:runMigrations:finish": [
                    async function ({ dryRun, error }) {
                      if (this.config.quiet) return;
                      const message = this.reporter.messages.steps("postAllMigrations", {
                        dryRun,
              Severity: Major
              Found in packages/events/defaultSubscribers/migrate/index.js and 1 other location - About 2 hrs to fix
              packages/events/defaultSubscribers/migrate/index.js on lines 18..27

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

              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

                      byCompilationId: {
                        ...state.byCompilationId,
                        ...Object.assign(
                          {},
                          ...Object.entries(action.sources.user).map(([id, compilation]) => ({
              Severity: Major
              Found in packages/debugger/lib/sourcemapping/reducers.js and 1 other location - About 2 hrs to fix
              packages/debugger/lib/sourcemapping/reducers.js on lines 42..54

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

              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 [
                isFunctionInternalValue,
                isFunctionInternalErrorResult,
                isFunctionInternalResult,
                functionInternalGuards
              packages/codec-components/src/utils/type-guards/value-and-result/bytes-dynamic.ts on lines 4..13
              packages/codec-components/src/utils/type-guards/value-and-result/bytes-static.ts on lines 4..13
              packages/codec-components/src/utils/type-guards/value-and-result/function-external.ts on lines 4..16

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

              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 [isAbiValue, isAbiErrorResult, isAbiResult, abiGuards] =
                valueAndResultTypeGuardHelper<
                  Format.Values.AbiValue,
                  Format.Errors.AbiErrorResult,
                  Format.Values.AbiResult
              packages/codec-components/src/utils/type-guards/value-and-result/elementary.ts on lines 15..36

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

              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

                      byContext: {
                        ...state.byContext,
                        ...Object.assign(
                          {},
                          ...Object.entries(action.sources.internal).map(
              Severity: Major
              Found in packages/debugger/lib/sourcemapping/reducers.js and 1 other location - About 2 hrs to fix
              packages/debugger/lib/sourcemapping/reducers.js on lines 31..41

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

              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 [
                isFunctionExternalValue,
                isFunctionExternalErrorResult,
                isFunctionExternalResult,
                functionExternalGuards
              packages/codec-components/src/utils/type-guards/value-and-result/bytes-dynamic.ts on lines 4..13
              packages/codec-components/src/utils/type-guards/value-and-result/bytes-static.ts on lines 4..13
              packages/codec-components/src/utils/type-guards/value-and-result/function-internal.ts on lines 4..16

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

              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 [
                isBytesDynamicValue,
                isBytesDynamicErrorResult,
                isBytesDynamicResult,
                bytesDynamicGuards
              packages/codec-components/src/utils/type-guards/value-and-result/bytes-static.ts on lines 4..13
              packages/codec-components/src/utils/type-guards/value-and-result/function-external.ts on lines 4..16
              packages/codec-components/src/utils/type-guards/value-and-result/function-internal.ts on lines 4..16

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

              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