dragonchain/dragonchain-sdk-javascript

View on GitHub
src/services/dragonchain-client/DragonchainClient.ts

Summary

Maintainability
F
1 wk
Test Coverage

File DragonchainClient.ts has 751 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Major
Found in src/services/dragonchain-client/DragonchainClient.ts - About 1 day to fix

    DragonchainClient has 57 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class DragonchainClient {
      /**
       * @hidden
       */
      private endpoint: string;
    Severity: Major
    Found in src/services/dragonchain-client/DragonchainClient.ts - About 1 day to fix

      Avoid deeply nested control flow statements.
      Open

                if ((customIndexField.options as CustomNumberFieldOptions).sortable !== undefined) optionsBody.sortable = (customIndexField.options as CustomNumberFieldOptions).sortable;
      Severity: Major
      Found in src/services/dragonchain-client/DragonchainClient.ts - About 45 mins to fix

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

          public getSmartContract = async (options: {
            /**
             * Contract id to get, mutually exclusive with transactionType
             */
            smartContractId?: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 6 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 655..669

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

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

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

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

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

        Refactorings

        Further Reading

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

          public deleteSmartContract = async (options: {
            /**
             * The id of the smart contract to delete. Should be a guid
             */
            smartContractId?: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 6 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 674..688

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

        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 7 locations. Consider refactoring.
        Open

          public getBlock = async (options: {
            /**
             * ID of the block to fetch
             */
            blockId: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 6 other locations - About 2 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 142..150
        src/services/dragonchain-client/DragonchainClient.ts on lines 183..191
        src/services/dragonchain-client/DragonchainClient.ts on lines 196..204
        src/services/dragonchain-client/DragonchainClient.ts on lines 722..730
        src/services/dragonchain-client/DragonchainClient.ts on lines 834..842
        src/services/dragonchain-client/DragonchainClient.ts on lines 854..862

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

        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 7 locations. Consider refactoring.
        Open

          public deleteTransactionType = async (options: {
            /**
             * The name of the transaction type to delete
             */
            transactionType: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 6 other locations - About 2 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 142..150
        src/services/dragonchain-client/DragonchainClient.ts on lines 183..191
        src/services/dragonchain-client/DragonchainClient.ts on lines 196..204
        src/services/dragonchain-client/DragonchainClient.ts on lines 364..372
        src/services/dragonchain-client/DragonchainClient.ts on lines 722..730
        src/services/dragonchain-client/DragonchainClient.ts on lines 854..862

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

        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 7 locations. Consider refactoring.
        Open

          public deleteApiKey = async (options: {
            /**
             * the key id of the key to delete
             */
            keyId: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 6 other locations - About 2 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 142..150
        src/services/dragonchain-client/DragonchainClient.ts on lines 183..191
        src/services/dragonchain-client/DragonchainClient.ts on lines 364..372
        src/services/dragonchain-client/DragonchainClient.ts on lines 722..730
        src/services/dragonchain-client/DragonchainClient.ts on lines 834..842
        src/services/dragonchain-client/DragonchainClient.ts on lines 854..862

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

        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 7 locations. Consider refactoring.
        Open

          public getTransactionType = async (options: {
            /**
             * The name of the transaction type to get
             */
            transactionType: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 6 other locations - About 2 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 142..150
        src/services/dragonchain-client/DragonchainClient.ts on lines 183..191
        src/services/dragonchain-client/DragonchainClient.ts on lines 196..204
        src/services/dragonchain-client/DragonchainClient.ts on lines 364..372
        src/services/dragonchain-client/DragonchainClient.ts on lines 722..730
        src/services/dragonchain-client/DragonchainClient.ts on lines 834..842

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

        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 7 locations. Consider refactoring.
        Open

          public getTransaction = async (options: {
            /**
             * the transaction id of the transaction to get
             */
            transactionId: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 6 other locations - About 2 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 183..191
        src/services/dragonchain-client/DragonchainClient.ts on lines 196..204
        src/services/dragonchain-client/DragonchainClient.ts on lines 364..372
        src/services/dragonchain-client/DragonchainClient.ts on lines 722..730
        src/services/dragonchain-client/DragonchainClient.ts on lines 834..842
        src/services/dragonchain-client/DragonchainClient.ts on lines 854..862

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

        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 7 locations. Consider refactoring.
        Open

          public getApiKey = async (options: {
            /**
             * the key id of the key to get
             */
            keyId: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 6 other locations - About 2 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 142..150
        src/services/dragonchain-client/DragonchainClient.ts on lines 196..204
        src/services/dragonchain-client/DragonchainClient.ts on lines 364..372
        src/services/dragonchain-client/DragonchainClient.ts on lines 722..730
        src/services/dragonchain-client/DragonchainClient.ts on lines 834..842
        src/services/dragonchain-client/DragonchainClient.ts on lines 854..862

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

        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 7 locations. Consider refactoring.
        Open

          public getPendingVerifications = async (options: {
            /**
             * The block ID to retrieve pending verifications for
             */
            blockId: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 6 other locations - About 2 hrs to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 142..150
        src/services/dragonchain-client/DragonchainClient.ts on lines 183..191
        src/services/dragonchain-client/DragonchainClient.ts on lines 196..204
        src/services/dragonchain-client/DragonchainClient.ts on lines 364..372
        src/services/dragonchain-client/DragonchainClient.ts on lines 834..842
        src/services/dragonchain-client/DragonchainClient.ts on lines 854..862

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

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

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

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

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

        Refactorings

        Further Reading

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

          public signEthereumTransaction = async (options: {
            /**
             * The name of the ethereum network to use for signing
             */
            name: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 2 hrs to fix
        src/interfaces/DragonchainClientInterfaces.ts on lines 112..142

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

        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

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

          public updateBitcoinInterchain = async (options: {
            /**
             * The name of the network to update
             */
            name: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 867..902

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

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

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

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

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

        Refactorings

        Further Reading

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

          public updateBinanceInterchain = async (options: {
            /**
             * The name of the network to update
             */
            name: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1103..1139

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

        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

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

          public createBitcoinInterchain = async (options: {
            /**
             * The name of the network to update
             */
            name: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 907..942

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

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

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

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

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

        Refactorings

        Further Reading

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

          public createBinanceInterchain = async (options: {
            /**
             * The name of the network to update
             */
            name: string;
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1144..1180

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

        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

          private async put(path: string, body: string | object) {
            const bodyString = typeof body === 'string' ? body : JSON.stringify(body);
            return this.makeRequest(path, 'PUT', undefined, bodyString);
          }
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1473..1476

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

        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

          private async patch(path: string, body: string | object) {
            const bodyString = typeof body === 'string' ? body : JSON.stringify(body);
            return this.makeRequest(path, 'PATCH', undefined, bodyString);
          }
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1465..1468

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

        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

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

            if (options.sortBy !== undefined) {
              queryParams.sort_by = options.sortBy;
              if (options.sortAscending !== undefined) queryParams.sort_asc = options.sortAscending;
            }
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 429..432

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

        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

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

            if (options.sortBy !== undefined) {
              queryParams.sort_by = options.sortBy;
              if (options.sortAscending !== undefined) queryParams.sort_asc = options.sortAscending;
            }
        Severity: Major
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 1 hr to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 354..357

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

        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

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

            if (!options.smartContractId) {
              if (!process.env.SMART_CONTRACT_ID) throw new FailureByDesign('PARAM_ERROR', 'Parameter `smartContractId` is required when not running within a smart contract');
              options.smartContractId = process.env.SMART_CONTRACT_ID;
            }
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 55 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 796..799

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

        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

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

            if (!options.smartContractId) {
              if (!process.env.SMART_CONTRACT_ID) throw new FailureByDesign('PARAM_ERROR', 'Parameter `smartContractId` is required when not running within a smart contract');
              options.smartContractId = process.env.SMART_CONTRACT_ID;
            }
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 55 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 768..771

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

        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

                if (customIndexField.type === 'tag') {
                  if ((customIndexField.options as CustomTagFieldOptions).separator !== undefined) optionsBody.separator = (customIndexField.options as CustomTagFieldOptions).separator;
                } else if (customIndexField.type === 'text') {
                  if ((customIndexField.options as CustomTextFieldOptions).noStem !== undefined) optionsBody.no_stem = (customIndexField.options as CustomTextFieldOptions).noStem;
                  if ((customIndexField.options as CustomTextFieldOptions).weight !== undefined) optionsBody.weight = (customIndexField.options as CustomTextFieldOptions).weight;
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 50 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1505..1509

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

        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

                } else if (customIndexField.type === 'number') {
                  if ((customIndexField.options as CustomNumberFieldOptions).sortable !== undefined) optionsBody.sortable = (customIndexField.options as CustomNumberFieldOptions).sortable;
                } else {
                  throw new FailureByDesign('PARAM_ERROR', 'Parameter `customIndexFields[].type must be `tag`, `text`, or `number`');
                }
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 50 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1499..1509

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

        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

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

          public updateEthereumInterchain = async (options: {
            /**
             * The name of the network to update
             */
            name: string;
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 40 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 992..1018

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

        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

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

          public createEthereumInterchain = async (options: {
            /**
             * The name of the network to update
             */
            name: string;
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 40 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1023..1049

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

        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

            return (await this.get(`/v1/block${this.generateQueryString(queryParams)}`)) as Response<QueryResult<BlockSchemaType>>;
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 40 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 358..358

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 48.

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

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

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

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

        Refactorings

        Further Reading

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

            return (await this.get(`/v1/transaction${this.generateQueryString(queryParams)}`)) as Response<QueryResult<L1DragonchainTransactionFull>>;
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 40 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 433..433

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 48.

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

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

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

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

        Refactorings

        Further Reading

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

              return (await this.get(`/v1/verifications/${options.blockId}?level=${options.level}`)) as Response<levelVerifications>;
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 35 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 1253..1253

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

        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

            return (await this.delete(`/v1/interchains/${options.blockchain}/${options.name}`)) as Response<SimpleResponse>;
        Severity: Minor
        Found in src/services/dragonchain-client/DragonchainClient.ts and 1 other location - About 35 mins to fix
        src/services/dragonchain-client/DragonchainClient.ts on lines 747..747

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

        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

        There are no issues that match your filters.

        Category
        Status