Showing 67 of 71 total issues

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

  getTaggedPosts(
    tag: string,
    params?: GeneralPostParameters
  ): Promise<PnutResponse<Post[]>> {
    return this.get(`/posts/tags/${tag}`, params)
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 113..118
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 187..192
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 194..199
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 232..237
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 342..347

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

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

  getRevision(
    postId: string,
    params?: GeneralPostParameters
  ): Promise<PnutResponse<Post[]>> {
    return this.get(`/posts/${postId}/revisions`, params)
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 187..192
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 194..199
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 218..223
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 232..237
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 342..347

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

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

  getFollowing(
    userId: string,
    params?: GeneralUserParameters
  ): Promise<PnutResponse<User[]>> {
    return this.get(`/users/${userId}/following`, params)
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 113..118
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 187..192
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 218..223
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 232..237
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 342..347

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

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

  getMessages(
    channelId: string,
    params?: GeneralMessageParameters
  ): Promise<PnutResponse<Message[]>> {
    return this.get(`/channels/${channelId}/messages`, params)
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 113..118
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 187..192
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 194..199
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 218..223
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 342..347

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

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

  getBookmarks(
    userId: string,
    params?: GeneralPostParameters
  ): Promise<PnutResponse<Post[]>> {
    return this.get(`/users/${userId}/bookmarks`, params)
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 113..118
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 187..192
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 194..199
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 218..223
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 232..237

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

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

  getChannel(
    channelId: string,
    params?: GeneralChannelParameters
  ): Promise<PnutResponse<Channel>> {
    return this.get(`/channels/${channelId}`, params)
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 1 other location - About 1 hr to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 120..125

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

  async run(input: Input): Promise<Output> {
    const title = getTitle({ q: input.params?.q, type: input.type })
    const commonDefaultParams: Input['params'] = {
      order: 'id',
    }
Severity: Minor
Found in src/plugins/domain/usecases/search.ts - About 1 hr to fix

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

  getPoll(
    pollId: string,
    params?: GetPollRequest
  ): Promise<PnutResponse<Poll>> {
    return this.get(`/polls/${pollId}`, params)
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 1 other location - About 1 hr to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 168..173

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

export function getUserFixture(attrs?: Parameters<IFactory<User>['build']>[0]) {
  return typeMap.user.build(attrs)
}
Severity: Major
Found in src/fixtures/index.ts and 1 other location - About 1 hr to fix
src/fixtures/index.ts on lines 18..20

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

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

export type CreateMessageRequest = {
  text: string
  reply_to?: string
  is_nsfw?: boolean
  entities?: {
Severity: Major
Found in src/plugins/domain/dto/message.ts and 1 other location - About 1 hr to fix
src/plugins/domain/dto/post.ts on lines 31..39

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

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

export type CreatePostRequest = {
  text: string
  reply_to?: string
  is_nsfw?: boolean
  entities?: {
Severity: Major
Found in src/plugins/domain/dto/post.ts and 1 other location - About 1 hr to fix
src/plugins/domain/dto/message.ts on lines 18..26

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

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

export function getPollFixture(attrs?: Parameters<IFactory<Poll>['build']>[0]) {
  return typeMap.poll.build(attrs)
}
Severity: Major
Found in src/fixtures/index.ts and 1 other location - About 1 hr to fix
src/fixtures/index.ts on lines 14..16

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

Function createVideoEmbedRaw has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function createVideoEmbedRaw(text: string): OEmbed.Video[] {
  return detectGenerators
    .reduce<ResObj[]>((rawHtmls, detectGenerator) => {
      let matcher
      while ((matcher = detectGenerator.regexp.exec(text)) !== null) {
Severity: Minor
Found in src/assets/ts/oembed.ts - About 1 hr to fix

Function insertText has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    insertText(text: string) {
      const textarea = this.$refs.textarea
      const selection = (document as any).selection
      if (selection) {
        textarea.focus()
Severity: Minor
Found in src/components/organisms/ComposeAbstract.ts - About 1 hr to fix

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

  createChannel(
    createChannelRequest: CreateChannelRequest,
    params?: GeneralChannelParameters
  ): Promise<PnutResponse<Channel>> {
    return this.post('/channels', createChannelRequest, params)
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 2 other locations - About 55 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 243..252
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 301..306

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

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

  createPost(
    createPostRequest: CreatePostRequest,
    params?: GeneralPostParameters
  ): Promise<PnutResponse<Post>> {
    return this.post('/posts', createPostRequest, params)
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 2 other locations - About 55 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 243..252
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 254..259

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

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

  createPrivateChannel(
    createPrivateChannelRequest: CreatePrivateChannelRequest,
    params?: GeneralChannelParameters
  ): Promise<PnutResponse<Message>> {
    return this.post(
Severity: Major
Found in src/plugins/infrastructure/repository/pnutRepositoryImpl.ts and 2 other locations - About 55 mins to fix
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 254..259
src/plugins/infrastructure/repository/pnutRepositoryImpl.ts on lines 301..306

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

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

  getPolls(
    params?: GeneralPollParameters & Pagination
  ): Promise<PnutResponse<Poll[]>> {
    return this.get('/users/me/polls', 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 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
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

  getBlockedUsers(
    params?: GeneralChannelParameters & Pagination
  ): Promise<PnutResponse<User[]>> {
    return this.get('/users/me/blocked', 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 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

  getChannels(
    params?: GeneralChannelParameters & ConnectionParameters
  ): Promise<PnutResponse<Channel[]>> {
    return this.get('/channels', 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 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
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

Severity
Category
Status
Source
Language