olehmell/subsocial-sdk

View on GitHub

Showing 393 of 393 total issues

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

  interface PalletBalancesAccountData extends Struct {
    readonly free: u128;
    readonly reserved: u128;
    readonly miscFrozen: u128;
    readonly feeFrozen: u128;
Severity: Minor
Found in packages/definitions/src/interfaces/types-lookup.ts and 1 other location - About 45 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 1331..1336

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

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 (res.status === 200) {
      log.debug(`CID ${cid.toString()} was pinned to ${this._ipfsClusterUrl}`)
    }
Severity: Minor
Found in packages/api/src/ipfs/index.ts and 1 other location - About 45 mins to fix
packages/api/src/ipfs/index.ts on lines 217..219

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

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

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

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

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

Refactorings

Further Reading

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

export function asCommentStruct (post: PostStruct): CommentStruct {
  if (!post.isComment) throw new Error('Not a comment')

  return post as CommentStruct
}
Severity: Minor
Found in packages/api/src/subsocial/flatteners/utils.ts and 1 other location - About 45 mins to fix
packages/api/src/subsocial/flatteners/utils.ts on lines 102..106

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

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

      PostMoved: AugmentedEvent<ApiType, [account: AccountId32, postId: u64, fromSpace: Option<u64>, toSpace: Option<u64>], { account: AccountId32, postId: u64, fromSpace: Option<u64>, toSpace: Option<u64> }>;
Severity: Minor
Found in packages/definitions/src/interfaces/augment-api-events.ts and 1 other location - About 45 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 1151..1156

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

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

    readonly asAnonymousCreated: {
      readonly anonymous: AccountId32;
      readonly who: AccountId32;
      readonly proxyType: SubsocialParachainRuntimeProxyType;
      readonly disambiguationIndex: u16;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asPostReactionUpdated: {
      readonly account: AccountId32;
      readonly postId: u64;
      readonly reactionId: u64;
      readonly reactionKind: PalletReactionsReactionKind;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asTeleportAssets: {
      readonly dest: XcmVersionedMultiLocation;
      readonly beneficiary: XcmVersionedMultiLocation;
      readonly assets: XcmVersionedMultiAssets;
      readonly feeAssetItem: u32;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asForceRegisterDomain: {
      readonly target: MultiAddress;
      readonly fullDomain: Bytes;
      readonly content: SubsocialSupportContent;
      readonly expiresIn: u32;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898

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

    readonly asPostReactionDeleted: {
      readonly account: AccountId32;
      readonly postId: u64;
      readonly reactionId: u64;
      readonly reactionKind: PalletReactionsReactionKind;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asProxyAdded: {
      readonly delegator: AccountId32;
      readonly delegatee: AccountId32;
      readonly proxyType: SubsocialParachainRuntimeProxyType;
      readonly delay: u32;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asReserveTransferAssets: {
      readonly dest: XcmVersionedMultiLocation;
      readonly beneficiary: XcmVersionedMultiLocation;
      readonly assets: XcmVersionedMultiAssets;
      readonly feeAssetItem: u32;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asReserveRepatriated: {
      readonly from: AccountId32;
      readonly to: AccountId32;
      readonly amount: u128;
      readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asProxyRemoved: {
      readonly delegator: AccountId32;
      readonly delegatee: AccountId32;
      readonly proxyType: SubsocialParachainRuntimeProxyType;
      readonly delay: u32;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 1163..1168
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

    readonly asPostReactionCreated: {
      readonly account: AccountId32;
      readonly postId: u64;
      readonly reactionId: u64;
      readonly reactionKind: PalletReactionsReactionKind;
Severity: Major
Found in packages/definitions/src/interfaces/types-lookup.ts and 9 other locations - About 40 mins to fix
packages/definitions/src/interfaces/types-lookup.ts on lines 225..230
packages/definitions/src/interfaces/types-lookup.ts on lines 312..317
packages/definitions/src/interfaces/types-lookup.ts on lines 325..330
packages/definitions/src/interfaces/types-lookup.ts on lines 332..337
packages/definitions/src/interfaces/types-lookup.ts on lines 1170..1175
packages/definitions/src/interfaces/types-lookup.ts on lines 1177..1182
packages/definitions/src/interfaces/types-lookup.ts on lines 1886..1891
packages/definitions/src/interfaces/types-lookup.ts on lines 1893..1898
packages/definitions/src/interfaces/types-lookup.ts on lines 2216..2221

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

  async findPublicPostsWithSomeDetails (filter: FindPostsWithDetailsQuery): Promise<RawPostWithSomeDetails[]> {
    return this.findPostsWithSomeDetails({ ...filter, visibility: 'onlyPublic' })
  }
Severity: Minor
Found in packages/api/src/subsocial/basic.ts and 1 other location - About 40 mins to fix
packages/api/src/subsocial/basic.ts on lines 120..122

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

  XcmV0JunctionBodyId: {
    _enum: {
      Unit: 'Null',
      Named: 'Bytes',
      Index: 'Compact<u32>',
Severity: Minor
Found in packages/definitions/src/interfaces/lookup.ts and 1 other location - About 40 mins to fix
packages/definitions/src/interfaces/lookup.ts on lines 653..663

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

  XcmV1MultiassetAssetInstance: {
    _enum: {
      Undefined: 'Null',
      Index: 'Compact<u128>',
      Array4: '[u8;4]',
Severity: Minor
Found in packages/definitions/src/interfaces/lookup.ts and 1 other location - About 40 mins to fix
packages/definitions/src/interfaces/lookup.ts on lines 485..495

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

  async findUnlistedPostsWithSomeDetails (filter: FindPostsWithDetailsQuery): Promise<RawPostWithSomeDetails[]> {
    return this.findPostsWithSomeDetails({ ...filter, visibility: 'onlyUnlisted' })
  }
Severity: Minor
Found in packages/api/src/subsocial/basic.ts and 1 other location - About 40 mins to fix
packages/api/src/subsocial/basic.ts on lines 116..118

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

      remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
Severity: Major
Found in packages/definitions/src/interfaces/augment-api-tx.ts and 3 other locations - About 40 mins to fix
packages/definitions/src/interfaces/augment-api-tx.ts on lines 739..739
packages/definitions/src/interfaces/augment-api-tx.ts on lines 758..758
packages/definitions/src/interfaces/augment-api-tx.ts on lines 770..770

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

  public async findPublicPosts (ids: AnyId[]) {
    return convertToNewPostDataArray(
       await this.base.findPublicPosts(idsToBns(ids))
    )
  }
Severity: Minor
Found in packages/api/src/subsocial/index.ts and 2 other locations - About 40 mins to fix
packages/api/src/subsocial/index.ts on lines 229..233
packages/api/src/subsocial/index.ts on lines 342..346

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

Severity
Category
Status
Source
Language