trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

Function runCommand has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const runCommand = async function (command, options) {
  try {
    // migrate Truffle data to the new location if necessary
    const configMigration = require("./config-migration");
    await configMigration.migrateTruffleDataIfNecessary();
Severity: Minor
Found in packages/core/lib/command-utils.js - About 1 hr to fix

    Function network has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      network: function () {
        var network_id = this.network_id;
    
        if (network_id == null) {
          var error =
    Severity: Minor
    Found in packages/contract/lib/contract/properties.js - About 1 hr to fix

      Function interpretBlockhashedMulticall has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private async interpretBlockhashedMulticall(
          decoding: Codec.CalldataDecoding,
          transaction: DecoderTypes.Transaction,
          additionalContexts: Contexts.Contexts = {},
          additionalAllocations?: {
      Severity: Minor
      Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

        Function invoke has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async invoke(operation) {
            const method = await this.detectMethod(operation);
            const { action } = method;
        
            switch (action) {
        Severity: Minor
        Found in packages/core/lib/debug/mocha.js - About 1 hr to fix

          Function decodeLogWithAdditionalOptions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public async decodeLogWithAdditionalOptions(
              log: DecoderTypes.Log,
              options: DecoderTypes.EventOptions = {},
              additionalContexts: Contexts.Contexts = {}
            ): Promise<LogDecoding[]> {
          Severity: Minor
          Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

            Function interpretDeadlinedMulticall has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              private async interpretDeadlinedMulticall(
                decoding: Codec.CalldataDecoding,
                transaction: DecoderTypes.Transaction,
                additionalContexts: Contexts.Contexts = {},
                additionalAllocations?: {
            Severity: Minor
            Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

              Function reverseEnsResolve has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public async reverseEnsResolve(address: string): Promise<Uint8Array | null> {
                  debug("reverse resolving %s", address);
                  if (this.ens === null) {
                    debug("no ens set up!");
                    return null;
              Severity: Minor
              Found in packages/decoder/lib/decoders.ts - About 1 hr to fix

                Function recognizeDecimal has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private recognizeDecimal(input: unknown): Codec.DecimalWrapResponse {
                    if (Utils.isBigNumber(input)) {
                      if (input.isFinite()) {
                        return {
                          kind: "decimal" as const,
                Severity: Minor
                Found in packages/encoder/lib/encoders.ts - About 1 hr to fix

                  Function unbox has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    unbox: async (
                      url: string,
                      destination: string,
                      options: unboxOptions = {},
                      config: any
                  Severity: Minor
                  Found in packages/box/box.ts - About 1 hr to fix

                    Function includeBlocks has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      async includeBlocks<
                        Block extends DataModel.Block | Omit<DataModel.Block, "hash">
                      >(options: {
                        blocks: (Block | undefined)[];
                        settings?: IncludeSettings;
                    Severity: Minor
                    Found in packages/db/src/network/index.ts - About 1 hr to fix

                      Function find has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          *find<N extends CollectionName<C>>(
                            collectionName: N,
                            ids: string[],
                            document: graphql.DocumentNode
                          ): Process<C, Resource<C, N>[]> {
                      Severity: Minor
                      Found in packages/db/src/meta/process/resources.ts - About 1 hr to fix

                        Function generateMapping has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          async function generateMapping() {
                            const promises = [];
                        
                            // Dequeue all the known paths, generating resolver promises,
                            // We'll add paths if we discover external package imports.
                        Severity: Minor
                        Found in packages/profiler/src/resolveAllSources.ts - About 1 hr to fix

                          Function concretize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const concretize = <C extends Collections, N extends AdapterName>(
                            options: AttachOptions<N> = {}
                          ): ConcretizeResult<C, N> => {
                            const { adapter: { name, settings } = { name: "indexeddb" } } = options;
                          
                          
                          Severity: Minor
                          Found in packages/db/src/meta/pouch/adapters/index.ts - About 1 hr to fix

                            Function configure has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const configure: Configure = <B extends Batch>(options: Options<B>) => {
                              return function* <I extends Input<B>, O extends Output<B>>(
                                inputs: Inputs<B, I>
                              ): Process<Collections, Outputs<B, O>> {
                                const {
                            Severity: Minor
                            Found in packages/db/src/meta/batch.ts - About 1 hr to fix

                              Function list has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                async list(index = 0) {
                                  if (index >= this.config.compilerRoots!.length) {
                                    throw new Error(
                                      `Failed to fetch the list of Solidity compilers from the following ` +
                                        `sources: ${this.config.compilerRoots}. Make sure you are connected ` +

                                Function preserve has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export async function* preserve(
                                  options: PreserveOptions
                                ): AsyncIterable<Event> {
                                  const { request, recipes } = options;
                                  const { recipe } = request;
                                Severity: Minor
                                Found in packages/preserve/lib/preserve.ts - About 1 hr to fix

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

                                        stack: createLeaf(
                                          [evm.next.state.stack],
                                  
                                          words => (words || []).map(word => Codec.Conversion.toBytes(word))
                                        ),
                                  Severity: Major
                                  Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                                  packages/debugger/lib/data/selectors/index.js on lines 544..548

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

                                  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

                                  module.exports = {
                                    command: "install",
                                    description:
                                      "ethpm has moved on faster than truffle's integration. " +
                                      "\n                This feature has been broken for some time, so we've disabled it. " +
                                  Severity: Major
                                  Found in packages/core/lib/commands/install/meta.js and 1 other location - About 1 hr to fix
                                  packages/core/lib/commands/publish/meta.js on lines 1..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 59.

                                  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

                                        stack: createLeaf(
                                          [evm.current.state.stack],
                                  
                                          words => (words || []).map(word => Codec.Conversion.toBytes(word))
                                        ),
                                  Severity: Major
                                  Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                                  packages/debugger/lib/data/selectors/index.js on lines 1814..1818

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

                                  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

                                  module.exports = {
                                    command: "publish",
                                    description:
                                      "ethpm has moved on faster than truffle's integration. " +
                                      "\n                This feature has been broken for some time, so we've disabled it. " +
                                  Severity: Major
                                  Found in packages/core/lib/commands/publish/meta.js and 1 other location - About 1 hr to fix
                                  packages/core/lib/commands/install/meta.js on lines 1..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 59.

                                  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