Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

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

  async transcribe ({
    mediaFilePath,
    model = new WhisperBuiltinModel('tiny'),
    language,
    format,

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

        if (this.hasRight(UserRight.MANAGE_USERS)) {
          overviewItems.children.push({
            label: $localize`Users`,
            routerLink: '/admin/users',
            iconName: 'user'
    Severity: Major
    Found in client/src/app/+admin/admin.component.ts and 10 other locations - About 1 hr to fix
    client/src/app/+admin/admin.component.ts on lines 72..78
    client/src/app/+admin/admin.component.ts on lines 116..122
    client/src/app/+admin/admin.component.ts on lines 124..130
    client/src/app/+admin/admin.component.ts on lines 132..138
    client/src/app/+admin/admin.component.ts on lines 140..146
    client/src/app/+admin/admin.component.ts on lines 148..154
    client/src/app/+admin/admin.component.ts on lines 156..162
    client/src/app/+admin/admin.component.ts on lines 199..205
    client/src/app/+admin/admin.component.ts on lines 207..213
    client/src/app/+admin/admin.component.ts on lines 215..221

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

        if (this.hasRight(UserRight.MANAGE_REGISTRATIONS)) {
          moderationItems.children.push({
            label: $localize`Registrations`,
            routerLink: '/admin/moderation/registrations/list',
            iconName: 'user'
    Severity: Major
    Found in client/src/app/+admin/admin.component.ts and 10 other locations - About 1 hr to fix
    client/src/app/+admin/admin.component.ts on lines 53..59
    client/src/app/+admin/admin.component.ts on lines 72..78
    client/src/app/+admin/admin.component.ts on lines 124..130
    client/src/app/+admin/admin.component.ts on lines 132..138
    client/src/app/+admin/admin.component.ts on lines 140..146
    client/src/app/+admin/admin.component.ts on lines 148..154
    client/src/app/+admin/admin.component.ts on lines 156..162
    client/src/app/+admin/admin.component.ts on lines 199..205
    client/src/app/+admin/admin.component.ts on lines 207..213
    client/src/app/+admin/admin.component.ts on lines 215..221

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

        if (this.hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)) {
          moderationItems.children.push({
            label: $localize`Muted servers`,
            routerLink: '/admin/moderation/blocklist/servers',
            iconName: 'peertube-x'
    Severity: Major
    Found in client/src/app/+admin/admin.component.ts and 10 other locations - About 1 hr to fix
    client/src/app/+admin/admin.component.ts on lines 53..59
    client/src/app/+admin/admin.component.ts on lines 72..78
    client/src/app/+admin/admin.component.ts on lines 116..122
    client/src/app/+admin/admin.component.ts on lines 124..130
    client/src/app/+admin/admin.component.ts on lines 132..138
    client/src/app/+admin/admin.component.ts on lines 140..146
    client/src/app/+admin/admin.component.ts on lines 156..162
    client/src/app/+admin/admin.component.ts on lines 199..205
    client/src/app/+admin/admin.component.ts on lines 207..213
    client/src/app/+admin/admin.component.ts on lines 215..221

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

      constructor (
        protected formReactiveService: FormReactiveService,
        private authService: AuthService,
        private notifier: Notifier,
        private userService: UserService,
    client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts on lines 32..40
    client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts on lines 33..41
    client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts on lines 53..61
    client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts on lines 30..38
    client/src/app/+reset-password/reset-password.component.ts on lines 21..29
    client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts on lines 21..29
    client/src/app/shared/shared-moderation/user-ban-modal.component.ts on lines 34..42
    client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts on lines 78..86

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

      constructor (
        protected formReactiveService: FormReactiveService,
        private userService: UserService,
        private notifier: Notifier,
        private router: Router,
    Severity: Major
    Found in client/src/app/+reset-password/reset-password.component.ts and 8 other locations - About 1 hr to fix
    client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts on lines 32..40
    client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts on lines 33..41
    client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts on lines 53..61
    client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts on lines 30..38
    client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts on lines 21..29
    client/src/app/shared/shared-moderation/user-ban-modal.component.ts on lines 34..42
    client/src/app/shared/shared-user-settings/user-video-settings.component.ts on lines 42..50
    client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts on lines 78..86

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

      constructor (
        protected formReactiveService: FormReactiveService,
        private videoOwnershipService: VideoOwnershipService,
        private notifier: Notifier,
        private userService: UserService,
    client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts on lines 32..40
    client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts on lines 33..41
    client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts on lines 53..61
    client/src/app/+reset-password/reset-password.component.ts on lines 21..29
    client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts on lines 21..29
    client/src/app/shared/shared-moderation/user-ban-modal.component.ts on lines 34..42
    client/src/app/shared/shared-user-settings/user-video-settings.component.ts on lines 42..50
    client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts on lines 78..86

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

      constructor (
        protected formReactiveService: FormReactiveService,
        private authService: AuthService,
        private notifier: Notifier,
        private videoPlaylistService: VideoPlaylistService,
    client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts on lines 32..40
    client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts on lines 33..41
    client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts on lines 53..61
    client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts on lines 30..38
    client/src/app/+reset-password/reset-password.component.ts on lines 21..29
    client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts on lines 21..29
    client/src/app/shared/shared-moderation/user-ban-modal.component.ts on lines 34..42
    client/src/app/shared/shared-user-settings/user-video-settings.component.ts on lines 42..50

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

      constructor (
        protected formReactiveService: FormReactiveService,
        private modalService: NgbModal,
        private notifier: Notifier,
        private userAdminService: UserAdminService,
    client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts on lines 32..40
    client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts on lines 33..41
    client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts on lines 53..61
    client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts on lines 30..38
    client/src/app/+reset-password/reset-password.component.ts on lines 21..29
    client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts on lines 21..29
    client/src/app/shared/shared-user-settings/user-video-settings.component.ts on lines 42..50
    client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts on lines 78..86

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

        if (this.hasRight(UserRight.MANAGE_LOGS)) {
          systemItems.children.push({
            label: $localize`Logs`,
            iconName: 'playlists',
            routerLink: '/admin/system/logs'
    Severity: Major
    Found in client/src/app/+admin/admin.component.ts and 10 other locations - About 1 hr to fix
    client/src/app/+admin/admin.component.ts on lines 53..59
    client/src/app/+admin/admin.component.ts on lines 72..78
    client/src/app/+admin/admin.component.ts on lines 116..122
    client/src/app/+admin/admin.component.ts on lines 124..130
    client/src/app/+admin/admin.component.ts on lines 132..138
    client/src/app/+admin/admin.component.ts on lines 140..146
    client/src/app/+admin/admin.component.ts on lines 148..154
    client/src/app/+admin/admin.component.ts on lines 156..162
    client/src/app/+admin/admin.component.ts on lines 199..205
    client/src/app/+admin/admin.component.ts on lines 215..221

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

      constructor (
        protected formReactiveService: FormReactiveService,
        private signupService: SignupService,
        private serverService: ServerService,
        private notifier: Notifier,
    client/src/app/+admin/moderation/registration-list/process-registration-modal.component.ts on lines 32..40
    client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.ts on lines 33..41
    client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts on lines 53..61
    client/src/app/+my-library/my-videos/modals/video-change-ownership.component.ts on lines 30..38
    client/src/app/+reset-password/reset-password.component.ts on lines 21..29
    client/src/app/shared/shared-moderation/user-ban-modal.component.ts on lines 34..42
    client/src/app/shared/shared-user-settings/user-video-settings.component.ts on lines 42..50
    client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts on lines 78..86

    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

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

        if (videoChannel.accountId !== this.user.Account.id) {
          throw new Error(`Channel ${videoChannel.name} is not owned by user ${this.user.username}`)
        }
    server/core/lib/user-import-export/importers/video-playlists-importer.ts on lines 93..95

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 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 4 locations. Consider refactoring.
    Open

      for (const column of notificationSettingColumns) {
        const data = {
          type: Sequelize.INTEGER,
          defaultValue: null,
          allowNull: true
    Severity: Major
    Found in server/core/initializers/migrations/0525-abuse-messages.ts and 3 other locations - About 1 hr to fix
    server/core/initializers/migrations/0525-abuse-messages.ts on lines 37..44
    server/core/initializers/migrations/0615-latest-versions-notification-settings.ts on lines 12..19
    server/core/initializers/migrations/0615-latest-versions-notification-settings.ts on lines 26..33

    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

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

          if (videoChannel.accountId !== this.user.Account.id) {
            throw new Error(`Channel ${videoChannel.name} is not owned by user ${this.user.username}`)
          }
    server/core/lib/user-import-export/importers/videos-importer.ts on lines 156..158

    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

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

              {
                attributes: [ 'id' ],
                model: AccountModel.unscoped(),
                required: true,
                include: [
    Severity: Major
    Found in server/core/models/oauth/oauth-token.ts and 1 other location - About 1 hr to fix
    server/core/models/video/video-comment.ts on lines 88..99

    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

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

                  {
                    attributes: [ 'id' ],
                    model: AccountModel.unscoped(),
                    required: true,
                    include: [
    Severity: Major
    Found in server/core/models/video/video-comment.ts and 1 other location - About 1 hr to fix
    server/core/models/oauth/oauth-token.ts on lines 45..56

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

        for (const column of notificationSettingColumns) {
          const data = {
            type: Sequelize.INTEGER,
            defaultValue: null,
            allowNull: true
    server/core/initializers/migrations/0525-abuse-messages.ts on lines 23..30
    server/core/initializers/migrations/0525-abuse-messages.ts on lines 37..44
    server/core/initializers/migrations/0615-latest-versions-notification-settings.ts on lines 26..33

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

      for (const column of notificationSettingColumns) {
        const data = {
          type: Sequelize.INTEGER,
          defaultValue: null,
          allowNull: false
    Severity: Major
    Found in server/core/initializers/migrations/0525-abuse-messages.ts and 3 other locations - About 1 hr to fix
    server/core/initializers/migrations/0525-abuse-messages.ts on lines 23..30
    server/core/initializers/migrations/0615-latest-versions-notification-settings.ts on lines 12..19
    server/core/initializers/migrations/0615-latest-versions-notification-settings.ts on lines 26..33

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

    export const VIDEO_CHANNEL_SYNC_STATE: { [ id in VideoChannelSyncStateType ]: string } = {
      [VideoChannelSyncState.FAILED]: 'Failed',
      [VideoChannelSyncState.SYNCED]: 'Synchronized',
      [VideoChannelSyncState.PROCESSING]: 'Processing',
      [VideoChannelSyncState.WAITING_FIRST_RUN]: 'Waiting first run'
    Severity: Major
    Found in server/core/initializers/constants.ts and 2 other locations - About 1 hr to fix
    server/core/initializers/constants.ts on lines 655..660
    server/core/initializers/constants.ts on lines 662..667

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

    export const USER_EXPORT_STATES: { [ id in UserExportStateType ]: string } = {
      [UserExportState.PENDING]: 'Pending',
      [UserExportState.PROCESSING]: 'Processing',
      [UserExportState.COMPLETED]: 'Completed',
      [UserExportState.ERRORED]: 'Failed'
    Severity: Major
    Found in server/core/initializers/constants.ts and 2 other locations - About 1 hr to fix
    server/core/initializers/constants.ts on lines 613..618
    server/core/initializers/constants.ts on lines 662..667

    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

    Severity
    Category
    Status
    Source
    Language