trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

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

  {
    type: "codec-interface",
    name: "Format.Values.NameValuePair",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 8 other locations - About 1 hr to fix
packages/codec-components/src/docs/content.tsx on lines 61..70
packages/codec-components/src/docs/content.tsx on lines 117..126
packages/codec-components/src/docs/content.tsx on lines 139..150
packages/codec-components/src/docs/content.tsx on lines 151..160
packages/codec-components/src/docs/content.tsx on lines 369..378
packages/codec-components/src/docs/content.tsx on lines 379..388
packages/codec-components/src/docs/content.tsx on lines 404..413
packages/codec-components/src/docs/content.tsx on lines 426..435

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  {
    type: "codec-interface",
    name: "RawReturnDecoding",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 8 other locations - About 1 hr to fix
packages/codec-components/src/docs/content.tsx on lines 61..70
packages/codec-components/src/docs/content.tsx on lines 139..150
packages/codec-components/src/docs/content.tsx on lines 151..160
packages/codec-components/src/docs/content.tsx on lines 281..290
packages/codec-components/src/docs/content.tsx on lines 369..378
packages/codec-components/src/docs/content.tsx on lines 379..388
packages/codec-components/src/docs/content.tsx on lines 404..413
packages/codec-components/src/docs/content.tsx on lines 426..435

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  {
    type: "codec-interface",
    name: "Format.Values.IntValue",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 8 other locations - About 1 hr to fix
packages/codec-components/src/docs/content.tsx on lines 61..70
packages/codec-components/src/docs/content.tsx on lines 117..126
packages/codec-components/src/docs/content.tsx on lines 139..150
packages/codec-components/src/docs/content.tsx on lines 151..160
packages/codec-components/src/docs/content.tsx on lines 281..290
packages/codec-components/src/docs/content.tsx on lines 369..378
packages/codec-components/src/docs/content.tsx on lines 404..413
packages/codec-components/src/docs/content.tsx on lines 426..435

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  {
    type: "codec-interface",
    name: "Format.Values.UfixedValue",
    content: (
      <>
Severity: Major
Found in packages/codec-components/src/docs/content.tsx and 8 other locations - About 1 hr to fix
packages/codec-components/src/docs/content.tsx on lines 61..70
packages/codec-components/src/docs/content.tsx on lines 117..126
packages/codec-components/src/docs/content.tsx on lines 139..150
packages/codec-components/src/docs/content.tsx on lines 151..160
packages/codec-components/src/docs/content.tsx on lines 281..290
packages/codec-components/src/docs/content.tsx on lines 369..378
packages/codec-components/src/docs/content.tsx on lines 379..388
packages/codec-components/src/docs/content.tsx on lines 404..413

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function externalCall has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

  pointer,
  newPointer,
  step,
  address,
  context,
Severity: Major
Found in packages/debugger/lib/txlog/actions/index.js - About 1 hr to fix

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

    module.exports = async function (options) {
      const { detectConfigOrDefault } = require("../../utils/utils");
      const { DashboardServer } = require("@truffle/dashboard");
      const address = require("address");
    
    
    Severity: Minor
    Found in packages/core/lib/commands/dashboard/run.js - About 1 hr to fix

      Function getHumanReadableSourceMap has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        getHumanReadableSourceMap: function (sourceMap) {
          const instructions = sourceMap.split(";");
      
          let processedInstruction = {
            start: 0,
      Severity: Minor
      Found in packages/source-map-utils/index.js - About 1 hr to fix

        Function compile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          compile: async function (options, callback) {
            const callbackPassed = typeof callback === "function";
            try {
              const config = prepareConfig(options);
        
        
        Severity: Minor
        Found in packages/workflow-compile/legacy/index.js - About 1 hr to fix

          Function setUserConfigViaPrompt has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            setUserConfigViaPrompt: async function () {
              if (
                !this.getUserConfig().get("analyticsSet") &&
                process.stdin.isTTY === true
              ) {
          Severity: Minor
          Found in packages/core/lib/commands/config/utils.js - About 1 hr to fix

            Function provision has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const provision = (contractAbstraction: any, truffleConfig: TruffleConfig) => {
              if (truffleConfig.provider) {
                contractAbstraction.setProvider(truffleConfig.provider);
              }
            
            
            Severity: Minor
            Found in packages/provisioner/src/index.ts - About 1 hr to fix

              Function constructor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function resolvers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  get resolvers() {
                    const log = debug.extend("resolvers");
                    log("Generating...");
                
                    const common = {
                Severity: Minor
                Found in packages/db/src/meta/graph/schema.ts - About 1 hr to fix

                  Function toImmutableReferencesInputs has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function toImmutableReferencesInputs(options: {
                    contracts: Contract[];
                  }): DataModel.ImmutableReferenceInput[] {
                    const immutableReferences: DataModel.ImmutableReferenceInput[] = options.contracts
                      .filter(contract => contract)
                  Severity: Minor
                  Found in packages/db/src/project/loadCompile/compilations.ts - About 1 hr to fix

                    Function runMigrations has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      runMigrations: async function (migrations: Migration[], options: Config) {
                        // Perform a shallow clone of the options object
                        // so that we can override the provider option without
                        // changing the original options object passed in.
                        const clone: any = {};
                    Severity: Minor
                    Found in packages/migrate/src/index.ts - About 1 hr to fix

                      Function sources has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async sources({ sources, options }: SourcesArgs) {
                          options = Config.default().merge(options);
                          options = normalizeOptions(options);
                          //note: "solidity" here includes JSON as well!
                          const [yulNames, solidityNames] = partition(Object.keys(sources), name =>
                      Severity: Minor
                      Found in packages/compile-solidity/src/index.ts - About 1 hr to fix

                        Function startDebugger has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const startDebugger = async () => {
                            setStatus(SessionStatus.PreparingForInitialization);
                            const provider = window.ethereum as any;
                            const networkId = await provider.request({
                              method: "net_version",
                        Severity: Minor
                        Found in packages/dashboard/src/components/composed/Debugger/index.tsx - About 1 hr to fix

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

                          module.exports = {
                            moduleFileExtensions: ["js", "json", "node", "ts"],
                            testEnvironment: "node",
                            globals: {
                              "ts-jest": {
                          Severity: Major
                          Found in packages/promise-tracker/jest.config.js and 1 other location - About 1 hr to fix
                          packages/dashboard-message-bus-e2e-test/jest.config.js on lines 1..15

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 62.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

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

                              "migrate:settingCompletedMigrations:succeed": [
                                async function (data) {
                                  if (this.config.quiet) return;
                                  const message = await this.reporter.endTransaction(data);
                                  this.logger.log(message);
                          Severity: Major
                          Found in packages/events/defaultSubscribers/migrate/index.js and 7 other locations - About 1 hr to fix
                          packages/events/defaultSubscribers/migrate/index.js on lines 54..60
                          packages/events/defaultSubscribers/migrate/index.js on lines 61..67
                          packages/events/defaultSubscribers/migrate/index.js on lines 68..74
                          packages/events/defaultSubscribers/migrate/index.js on lines 94..100
                          packages/events/defaultSubscribers/migrate/index.js on lines 101..107
                          packages/events/defaultSubscribers/migrate/index.js on lines 115..121
                          packages/events/defaultSubscribers/migrate/index.js on lines 128..134

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 62.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

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

                              "deployment:confirmation": [
                                async function (data) {
                                  if (this.config.quiet) return;
                                  const message = await this.reporter.confirmation(data);
                                  this.logger.log(message);
                          Severity: Major
                          Found in packages/events/defaultSubscribers/migrate/index.js and 7 other locations - About 1 hr to fix
                          packages/events/defaultSubscribers/migrate/index.js on lines 46..52
                          packages/events/defaultSubscribers/migrate/index.js on lines 54..60
                          packages/events/defaultSubscribers/migrate/index.js on lines 61..67
                          packages/events/defaultSubscribers/migrate/index.js on lines 68..74
                          packages/events/defaultSubscribers/migrate/index.js on lines 94..100
                          packages/events/defaultSubscribers/migrate/index.js on lines 101..107
                          packages/events/defaultSubscribers/migrate/index.js on lines 128..134

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 62.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

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

                              "migrate:migration:error": [
                                async function (errorData) {
                                  if (this.config.quiet) return;
                                  const message = await this.reporter.error(errorData);
                                  this.logger.log(message);
                          Severity: Major
                          Found in packages/events/defaultSubscribers/migrate/index.js and 7 other locations - About 1 hr to fix
                          packages/events/defaultSubscribers/migrate/index.js on lines 46..52
                          packages/events/defaultSubscribers/migrate/index.js on lines 54..60
                          packages/events/defaultSubscribers/migrate/index.js on lines 61..67
                          packages/events/defaultSubscribers/migrate/index.js on lines 94..100
                          packages/events/defaultSubscribers/migrate/index.js on lines 101..107
                          packages/events/defaultSubscribers/migrate/index.js on lines 115..121
                          packages/events/defaultSubscribers/migrate/index.js on lines 128..134

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 62.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language