Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

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

function doesAccountNameWithHostExist (nameWithDomain: string, res: Response, sendNotFound = true) {
  const promise = AccountModel.loadByNameWithHost(nameWithDomain)

  return doesAccountExist(promise, res, sendNotFound)
}
Severity: Minor
Found in server/core/middlewares/validators/shared/accounts.ts and 1 other location - About 40 mins to fix
server/core/middlewares/validators/shared/accounts.ts on lines 14..18

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

    forkJoin([
      this.autoTagsService.listAvailable({ accountName }),
      this.autoTagsService.getCommentPolicies({ accountName })
    ]).subscribe(([ resAvailable, policies ]) => {
      this.tags = resAvailable.available
client/src/app/+remote-interaction/remote-interaction.component.ts on lines 37..57

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

export class CloseMenuGuard extends MenuGuard {
  constructor (menu: MenuService, screen: ScreenService) {
    super(menu, screen, false)
  }
}
Severity: Minor
Found in client/src/app/core/routing/menu-guard.service.ts and 1 other location - About 40 mins to fix
client/src/app/core/routing/menu-guard.service.ts on lines 24..28

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

    this.modalRef = this.modalService.open(this.modal, {
      centered: true,
      backdrop: 'static',
      keyboard: false,
      size: 'lg'
Severity: Minor
Found in client/src/app/modal/custom-modal.component.ts and 1 other location - About 40 mins to fix
client/src/app/modal/account-setup-warning-modal.component.ts on lines 65..70

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

  constructor (options: {
    user: MUserDefault

    activityPubFilenames: ActivityPubFilenames

server/core/lib/user-import-export/importers/abstract-user-importer.ts on lines 19..29

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

    await addServerInBlocklist({
      byAccountId: this.user.Account.id,
      targetServerId: serverToBlock.id,
      removeNotificationOfUserId: this.user.id
    })
server/core/lib/user-import-export/importers/account-blocklist-importer.ts on lines 47..51

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

    this.users = this.users.filter(u => u.Account.id !== this.payload.accountId)
Severity: Minor
Found in server/core/lib/notifier/shared/comment/comment-mention.ts and 1 other location - About 40 mins to fix
server/core/lib/notifier/shared/abuse/new-abuse-message-for-moderators.ts on lines 15..15

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

    this.videoService.getVideoChannelVideos({
      videoChannel: this.videoChannel,
      videoPagination: {
        currentPage: 1,
        itemsPerPage: 0
Severity: Minor
Found in client/src/app/+video-channels/video-channels.component.ts and 1 other location - About 40 mins to fix
client/src/app/+accounts/accounts.component.ts on lines 230..239

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

  if (video.isOwned() && !canVideoBeFederated(video)) {
    logger.warn(`Do not process update cache file on video ${activity.object} that cannot be federated`)
    return
  }
Severity: Minor
Found in server/core/lib/activitypub/process/process-update.ts and 1 other location - About 40 mins to fix
server/core/lib/activitypub/process/process-create.ts on lines 92..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 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

function isMVideoRedundancyFileVideo (
  o: MVideoRedundancyFileVideo | MVideoRedundancyStreamingPlaylistVideo
): o is MVideoRedundancyFileVideo {
  return !!(o as MVideoRedundancyFileVideo).VideoFile
}
Severity: Minor
Found in server/core/lib/schedulers/videos-redundancy-scheduler.ts and 1 other location - About 40 mins to fix
server/core/types/models/video/video-streaming-playlist.ts on lines 41..43

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

export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo {
  return !!(value as MStreamingPlaylist).videoId
}
Severity: Minor
Found in server/core/types/models/video/video-streaming-playlist.ts and 1 other location - About 40 mins to fix
server/core/lib/schedulers/videos-redundancy-scheduler.ts on lines 38..42

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

    await addAccountInBlocklist({
      byAccountId: this.user.Account.id,
      targetAccountId: accountToBlock.id,
      removeNotificationOfUserId: this.user.id
    })
server/core/lib/user-import-export/importers/account-blocklist-importer.ts on lines 59..63

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

    forkJoin([
      this.search.searchVideos({ search: uri }),
      this.search.searchVideoChannels({ search: uri })
    ]).subscribe(([ videoResult, channelResult ]) => {
      let redirectUrl: string
client/src/app/+my-account/my-account-auto-tag-policies/my-account-auto-tag-policies.component.ts on lines 60..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 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

export async function setAndSaveVideoAutomaticTags (options: {
  video: MVideo
  automaticTags: { accountId: number, name: string }[]
  transaction?: Transaction
}) {
Severity: Minor
Found in server/core/lib/automatic-tags/automatic-tags.ts and 1 other location - About 40 mins to fix
server/core/lib/automatic-tags/automatic-tags.ts on lines 16..47

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

    this.moderators = this.moderators.filter(m => m.Account.id !== this.message.accountId)
server/core/lib/notifier/shared/comment/comment-mention.ts on lines 46..46

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

Consider simplifying this complex logical expression.
Open

  if (
    (compacted.type === 'Create' && (compacted?.object?.type === 'WatchAction' || compacted?.object?.type === 'CacheFile')) ||
    (compacted.type === 'Undo' && compacted?.object?.type === 'Create' && compacted?.object?.object.type === 'CacheFile')
  ) {
    safe = false
Severity: Major
Found in server/core/helpers/peertube-jsonld.ts - About 40 mins to fix

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

    export const VIDEO_PRIVACY_VALIDATOR: BuildFormValidator = {
      VALIDATORS: [ Validators.required ],
      MESSAGES: {
        required: $localize`Video privacy is required.`
      }
    Severity: Major
    Found in client/src/app/shared/form-validators/video-validators.ts and 16 other locations - About 40 mins to fix
    client/src/app/+signup/+register/shared/register-validators.ts on lines 4..9
    client/src/app/shared/form-validators/common-validators.ts on lines 4..9
    client/src/app/shared/form-validators/custom-config-validators.ts on lines 4..9
    client/src/app/shared/form-validators/custom-config-validators.ts on lines 18..23
    client/src/app/shared/form-validators/login-validators.ts on lines 4..11
    client/src/app/shared/form-validators/login-validators.ts on lines 13..20
    client/src/app/shared/form-validators/reset-password-validators.ts on lines 4..11
    client/src/app/shared/form-validators/user-validators.ts on lines 55..62
    client/src/app/shared/form-validators/user-validators.ts on lines 64..71
    client/src/app/shared/form-validators/user-validators.ts on lines 119..124
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 11..16
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 18..23
    client/src/app/shared/form-validators/video-ownership-change-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-playlist-validators.ts on lines 18..25
    client/src/app/shared/form-validators/video-validators.ts on lines 58..63

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

    export const SERVICES_TWITTER_USERNAME_VALIDATOR: BuildFormValidator = {
      VALIDATORS: [ Validators.required ],
      MESSAGES: {
        required: $localize`Twitter username is required.`
      }
    client/src/app/+signup/+register/shared/register-validators.ts on lines 4..9
    client/src/app/shared/form-validators/common-validators.ts on lines 4..9
    client/src/app/shared/form-validators/custom-config-validators.ts on lines 4..9
    client/src/app/shared/form-validators/login-validators.ts on lines 4..11
    client/src/app/shared/form-validators/login-validators.ts on lines 13..20
    client/src/app/shared/form-validators/reset-password-validators.ts on lines 4..11
    client/src/app/shared/form-validators/user-validators.ts on lines 55..62
    client/src/app/shared/form-validators/user-validators.ts on lines 64..71
    client/src/app/shared/form-validators/user-validators.ts on lines 119..124
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 11..16
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 18..23
    client/src/app/shared/form-validators/video-ownership-change-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-playlist-validators.ts on lines 18..25
    client/src/app/shared/form-validators/video-validators.ts on lines 22..27
    client/src/app/shared/form-validators/video-validators.ts on lines 58..63

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

    export const LOGIN_PASSWORD_VALIDATOR: BuildFormValidator = {
      VALIDATORS: [
        Validators.required
      ],
      MESSAGES: {
    Severity: Major
    Found in client/src/app/shared/form-validators/login-validators.ts and 16 other locations - About 40 mins to fix
    client/src/app/+signup/+register/shared/register-validators.ts on lines 4..9
    client/src/app/shared/form-validators/common-validators.ts on lines 4..9
    client/src/app/shared/form-validators/custom-config-validators.ts on lines 4..9
    client/src/app/shared/form-validators/custom-config-validators.ts on lines 18..23
    client/src/app/shared/form-validators/login-validators.ts on lines 4..11
    client/src/app/shared/form-validators/reset-password-validators.ts on lines 4..11
    client/src/app/shared/form-validators/user-validators.ts on lines 55..62
    client/src/app/shared/form-validators/user-validators.ts on lines 64..71
    client/src/app/shared/form-validators/user-validators.ts on lines 119..124
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 11..16
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 18..23
    client/src/app/shared/form-validators/video-ownership-change-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-playlist-validators.ts on lines 18..25
    client/src/app/shared/form-validators/video-validators.ts on lines 22..27
    client/src/app/shared/form-validators/video-validators.ts on lines 58..63

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

    export const USER_EXISTING_PASSWORD_VALIDATOR: BuildFormValidator = {
      VALIDATORS: [
        Validators.required
      ],
      MESSAGES: {
    Severity: Major
    Found in client/src/app/shared/form-validators/user-validators.ts and 16 other locations - About 40 mins to fix
    client/src/app/+signup/+register/shared/register-validators.ts on lines 4..9
    client/src/app/shared/form-validators/common-validators.ts on lines 4..9
    client/src/app/shared/form-validators/custom-config-validators.ts on lines 4..9
    client/src/app/shared/form-validators/custom-config-validators.ts on lines 18..23
    client/src/app/shared/form-validators/login-validators.ts on lines 4..11
    client/src/app/shared/form-validators/login-validators.ts on lines 13..20
    client/src/app/shared/form-validators/reset-password-validators.ts on lines 4..11
    client/src/app/shared/form-validators/user-validators.ts on lines 64..71
    client/src/app/shared/form-validators/user-validators.ts on lines 119..124
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 11..16
    client/src/app/shared/form-validators/video-captions-validators.ts on lines 18..23
    client/src/app/shared/form-validators/video-ownership-change-validators.ts on lines 4..9
    client/src/app/shared/form-validators/video-playlist-validators.ts on lines 18..25
    client/src/app/shared/form-validators/video-validators.ts on lines 22..27
    client/src/app/shared/form-validators/video-validators.ts on lines 58..63

    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