dragonchain/dragonchain-sdk-javascript

View on GitHub

Showing 36 of 40 total issues

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

const getIdFromFile = async (injected: any = { readFileAsync }): Promise<string> => {
  let config: any = {};
  try {
    config = ini.parse(await injected.readFileAsync(getConfigFilePath(), 'utf-8'));
  } catch (e) {
Severity: Major
Found in src/services/config-service/ConfigCient.ts and 1 other location - About 3 hrs to fix
src/services/config-service/ConfigCient.ts on lines 96..105

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

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

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

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

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

Refactorings

Further Reading

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

const getEndpointFromFile = async (dragonchainId: string, injected: any = { readFileAsync }): Promise<string> => {
  let config: any = {};
  try {
    config = ini.parse(await injected.readFileAsync(getConfigFilePath(), 'utf-8'));
  } catch (e) {
Severity: Major
Found in src/services/config-service/ConfigCient.ts and 1 other location - About 3 hrs to fix
src/services/config-service/ConfigCient.ts on lines 80..89

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

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

  header: {
    /**
     * name of a smart contract, or 'transaction'
     */
    txn_type: string;
Severity: Major
Found in src/interfaces/DragonchainClientInterfaces.ts and 1 other location - About 2 hrs to fix
src/services/dragonchain-client/DragonchainClient.ts on lines 1054..1083

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

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

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

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

  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

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

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

Severity
Category
Status
Source
Language