Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

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

export const VIDEO_PLAYLIST_PRIVACY_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [
    Validators.required
  ],
  MESSAGES: {
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-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 VIDEO_CAPTION_LANGUAGE_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`Video caption language 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/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 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 RESET_PASSWORD_CONFIRM_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [
    Validators.required
  ],
  MESSAGES: {
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/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_OTP_TOKEN_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 55..62
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_ROLE_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`User role is required.`
  }
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 55..62
client/src/app/shared/form-validators/user-validators.ts on lines 64..71
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 INSTANCE_NAME_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`Instance name 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 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 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 REQUIRED_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`This field is required.`
  }
Severity: Major
Found in client/src/app/shared/form-validators/common-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/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 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 REGISTER_TERMS_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.requiredTrue ],
  MESSAGES: {
    required: $localize`You must agree with the instance terms in order to register on it.`
  }
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 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_USERNAME_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 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 OWNERSHIP_CHANGE_CHANNEL_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`The channel 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/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-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 VIDEO_CAPTION_FILE_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`Video caption file 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/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 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 VIDEO_CHANNEL_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`Video channel 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 22..27

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 VIDEO_CAPTION_FILE_CONTENT_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    required: $localize`Caption content 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/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-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 5 locations. Consider refactoring.
Open

  onNearOfBottom () {
    if (!hasMoreItems(this.pagination)) return

    this.pagination.currentPage += 1
    this.loadVideoPlaylists()
client/src/app/+accounts/account-video-channels/account-video-channels.component.ts on lines 153..159
client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts on lines 96..102
client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts on lines 128..134
client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts on lines 114..120

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

  onNearOfBottom () {
    if (!hasMoreItems(this.pagination)) return

    this.pagination.currentPage += 1

client/src/app/+accounts/account-video-channels/account-video-channels.component.ts on lines 153..159
client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts on lines 128..134
client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts on lines 114..120
client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts on lines 62..67

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

  onNearOfBottom () {
    if (!hasMoreItems(this.channelPagination)) return

    this.channelPagination.currentPage += 1

client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts on lines 96..102
client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts on lines 128..134
client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts on lines 114..120
client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts on lines 62..67

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

export function isViewActivityValid (activity: any) {
  return isBaseActivityValid(activity, 'View') &&
    isActivityPubUrlValid(activity.actor) &&
    isActivityPubUrlValid(activity.object)
}
Severity: Major
Found in server/core/helpers/custom-validators/activitypub/activity.ts and 3 other locations - About 40 mins to fix
server/core/helpers/custom-validators/activitypub/activity.ts on lines 56..60
server/core/helpers/custom-validators/activitypub/activity.ts on lines 138..142
server/core/helpers/custom-validators/activitypub/activity.ts on lines 144..148

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

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

  download () {
    window.location.assign(this.getVideoFileLink())

    this.downloaded.emit()
  }
client/src/app/shared/shared-video-miniature/download/video-generate-download.component.ts on lines 81..85

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

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

  async createOptimizeOrMergeAudioJobs (options: {
    video: MVideoFullLight
    videoFile: MVideoFile
    isNewVideo: boolean
    user: MUserId
server/core/lib/transcoding/create-transcoding-job.ts on lines 5..13

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

export function isApproveReplyActivityValid (activity: any) {
  return isBaseActivityValid(activity, 'ApproveReply') &&
    isActivityPubUrlValid(activity.object) &&
    isActivityPubUrlValid(activity.inReplyTo)
}
Severity: Major
Found in server/core/helpers/custom-validators/activitypub/activity.ts and 3 other locations - About 40 mins to fix
server/core/helpers/custom-validators/activitypub/activity.ts on lines 56..60
server/core/helpers/custom-validators/activitypub/activity.ts on lines 77..81
server/core/helpers/custom-validators/activitypub/activity.ts on lines 144..148

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