Showing 67 of 71 total issues

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

  getSubscribedChannels(
    params?: GeneralChannelParameters & ConnectionParameters
  ): Promise<PnutResponse<Channel[]>> {
    return this.get('/users/me/channels/subscribed', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 107..111
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 127..131
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 133..137
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 146..150
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 156..160
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 162..166

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

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

  getFiles(
    params?: GeneralFileParameters & Pagination
  ): Promise<PnutResponse<PnutFile[]>> {
    return this.get('/users/me/files', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 107..111
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 127..131
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 146..150
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 156..160
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 162..166
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 181..185

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

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

  searchPosts(
    params?: SearchPostRequest & Pagination
  ): Promise<PnutResponse<Post[]>> {
    return this.get('/posts/search', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 107..111
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 127..131
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 133..137
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 156..160
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 162..166
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 181..185

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

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

  getMutedUsers(
    params?: GeneralChannelParameters & Pagination
  ): Promise<PnutResponse<User[]>> {
    return this.get('/users/me/muted', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 107..111
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 127..131
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 133..137
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 146..150
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 162..166
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 181..185

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

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

  unblock(userId: string): Promise<PnutResponse<User>> {
    return this.delete(`/users/${userId}/block`)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 5 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 73..75
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 81..83
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 85..87
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 89..91
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 93..95

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

  follow(userId: string): Promise<PnutResponse<User>> {
    return this.put(`/users/${userId}/follow`)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 5 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 73..75
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 77..79
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 81..83
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 85..87
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 93..95

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

  block(userId: string): Promise<PnutResponse<User>> {
    return this.put(`/users/${userId}/block`)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 5 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 77..79
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 81..83
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 85..87
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 89..91
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 93..95

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

  mute(userId: string): Promise<PnutResponse<User>> {
    return this.put(`/users/${userId}/mute`)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 5 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 73..75
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 77..79
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 85..87
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 89..91
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 93..95

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

  unmute(userId: string): Promise<PnutResponse<User>> {
    return this.delete(`/users/${userId}/mute`)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 5 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 73..75
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 77..79
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 81..83
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 89..91
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 93..95

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

  unfollow(userId: string): Promise<PnutResponse<User>> {
    return this.delete(`/users/${userId}/follow`)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 5 other locations - About 50 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 73..75
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 77..79
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 81..83
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 85..87
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 89..91

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

Function messageHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  async messageHandler(input: Input, obj: object) {
    if (isConnection(obj)) {
      const { subscriptionMap, unreads } = await this.getDefaultSubscriptionIds(
        obj.meta.connection_id
      )
Severity: Minor
Found in src/plugins/domain/usecases/createConnection.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  constructor(
    @inject(PnutRepository.token)
    private readonly pnutRepository: PnutRepository,
    @inject(ConfigRepository.token)
    private readonly configRepository: ConfigRepository
Severity: Minor
Found in src/plugins/domain/usecases/createConnection.ts and 1 other location - About 45 mins to fix
src/plugins/domain/usecases/getPosts.ts on lines 29..34

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

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

  constructor(
    @inject(PnutRepository.token)
    private readonly pnutRepository: PnutRepository,
    @inject(ConfigRepository.token)
    private readonly configRepository: ConfigRepository
Severity: Minor
Found in src/plugins/domain/usecases/getPosts.ts and 1 other location - About 45 mins to fix
src/plugins/domain/usecases/createConnection.ts on lines 61..66

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

  getMentions(params?: MentionRequest): Promise<PnutResponse<Post[]>> {
    return this.get('/users/me/mentions', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 35 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 175..179
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 201..205
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 214..216
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 239..241
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 356..358
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 360..362

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

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

  getUnifiedStream(params?: HomeStreamRequest): Promise<PnutResponse<Post[]>> {
    return this.get('/posts/streams/unified', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 35 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 175..179
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 201..205
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 239..241
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 331..333
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 356..358
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 360..362

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

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

  getGlobal(params?: GeneralPostParameters): Promise<PnutResponse<Post[]>> {
    return this.get('/posts/streams/global', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 35 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 175..179
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 201..205
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 214..216
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 239..241
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 331..333
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 360..362

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

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

  searchUsers(params: SearchUsersRequest): Promise<PnutResponse<User[]>> {
    return this.get('/users/search', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 35 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 175..179
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 201..205
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 214..216
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 331..333
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 356..358
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 360..362

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

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

  getInteractions(
    params?: GetInteractionParameters
  ): Promise<PnutResponse<InteractionType[]>> {
    return this.get('/users/me/interactions', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 35 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 175..179
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 214..216
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 239..241
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 331..333
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 356..358
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 360..362

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

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

  searchChannels(
    params?: SearchChannelRequest
  ): Promise<PnutResponse<Channel[]>> {
    return this.get('/channels/search', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 35 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 201..205
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 214..216
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 239..241
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 331..333
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 356..358
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 360..362

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

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

  getHomeStream(params?: HomeStreamRequest): Promise<PnutResponse<Post[]>> {
    return this.get('/posts/streams/me', params)
  }
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 6 other locations - About 35 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 175..179
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 201..205
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 214..216
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 239..241
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 331..333
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 356..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 47.

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