Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

Function runCommand has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async runCommand (options: {
    silent?: boolean // false by default
  } = {}) {
    const { silent = false } = options

Severity: Minor
Found in packages/ffmpeg/src/ffmpeg-command-wrapper.ts - About 1 hr to fix

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

      {
        const data = {
          type: Sequelize.STRING,
          defaultValue: null,
          allowNull: false
    Severity: Major
    Found in server/core/initializers/migrations/0725-node-version.ts and 7 other locations - About 1 hr to fix
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 11..18
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 25..32
    server/core/initializers/migrations/0725-node-version.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 20..27
    server/core/initializers/migrations/0725-node-version.ts on lines 49..56
    server/core/initializers/migrations/0855-transcription.ts on lines 27..34
    server/core/initializers/migrations/0855-transcription.ts on lines 41..48

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

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

      {
        const data = {
          type: Sequelize.INTEGER,
          defaultValue: null,
          allowNull: true
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 25..32
    server/core/initializers/migrations/0725-node-version.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 20..27
    server/core/initializers/migrations/0725-node-version.ts on lines 40..47
    server/core/initializers/migrations/0725-node-version.ts on lines 49..56
    server/core/initializers/migrations/0855-transcription.ts on lines 27..34
    server/core/initializers/migrations/0855-transcription.ts on lines 41..48

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

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

      {
        const data = {
          type: Sequelize.STRING,
          defaultValue: null,
          allowNull: true
    Severity: Major
    Found in server/core/initializers/migrations/0725-node-version.ts and 7 other locations - About 1 hr to fix
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 11..18
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 25..32
    server/core/initializers/migrations/0725-node-version.ts on lines 20..27
    server/core/initializers/migrations/0725-node-version.ts on lines 40..47
    server/core/initializers/migrations/0725-node-version.ts on lines 49..56
    server/core/initializers/migrations/0855-transcription.ts on lines 27..34
    server/core/initializers/migrations/0855-transcription.ts on lines 41..48

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

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

        {
          const data = {
            type: Sequelize.INTEGER,
            defaultValue: null,
            allowNull: true
    Severity: Major
    Found in server/core/initializers/migrations/0855-transcription.ts and 7 other locations - About 1 hr to fix
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 11..18
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 25..32
    server/core/initializers/migrations/0725-node-version.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 20..27
    server/core/initializers/migrations/0725-node-version.ts on lines 40..47
    server/core/initializers/migrations/0725-node-version.ts on lines 49..56
    server/core/initializers/migrations/0855-transcription.ts on lines 41..48

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

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

      {
        const data = {
          type: Sequelize.INTEGER,
          defaultValue: null,
          allowNull: false
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 20..27
    server/core/initializers/migrations/0725-node-version.ts on lines 40..47
    server/core/initializers/migrations/0725-node-version.ts on lines 49..56
    server/core/initializers/migrations/0855-transcription.ts on lines 27..34
    server/core/initializers/migrations/0855-transcription.ts on lines 41..48

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

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

      {
        const data = {
          type: Sequelize.STRING,
          defaultValue: null,
          allowNull: true
    Severity: Major
    Found in server/core/initializers/migrations/0725-node-version.ts and 7 other locations - About 1 hr to fix
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 11..18
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 25..32
    server/core/initializers/migrations/0725-node-version.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 40..47
    server/core/initializers/migrations/0725-node-version.ts on lines 49..56
    server/core/initializers/migrations/0855-transcription.ts on lines 27..34
    server/core/initializers/migrations/0855-transcription.ts on lines 41..48

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

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

      {
        const data = {
          type: Sequelize.STRING,
          defaultValue: null,
          allowNull: false
    Severity: Major
    Found in server/core/initializers/migrations/0725-node-version.ts and 7 other locations - About 1 hr to fix
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 11..18
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 25..32
    server/core/initializers/migrations/0725-node-version.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 20..27
    server/core/initializers/migrations/0725-node-version.ts on lines 40..47
    server/core/initializers/migrations/0855-transcription.ts on lines 27..34
    server/core/initializers/migrations/0855-transcription.ts on lines 41..48

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

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

        {
          const data = {
            type: Sequelize.INTEGER,
            defaultValue: null,
            allowNull: false
    Severity: Major
    Found in server/core/initializers/migrations/0855-transcription.ts and 7 other locations - About 1 hr to fix
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 11..18
    server/core/initializers/migrations/0700-edition-finished-notification.ts on lines 25..32
    server/core/initializers/migrations/0725-node-version.ts on lines 11..18
    server/core/initializers/migrations/0725-node-version.ts on lines 20..27
    server/core/initializers/migrations/0725-node-version.ts on lines 40..47
    server/core/initializers/migrations/0725-node-version.ts on lines 49..56
    server/core/initializers/migrations/0855-transcription.ts on lines 27..34

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 56.

    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

          avatar: {
            file: {
              size: {
                max: CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max
              },
    Severity: Major
    Found in server/core/lib/server-config-manager.ts and 4 other locations - About 1 hr to fix
    server/core/controllers/misc.ts on lines 155..162
    server/core/controllers/misc.ts on lines 174..181
    server/core/lib/server-config-manager.ts on lines 239..246
    server/core/lib/server-config-manager.ts on lines 258..265

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

    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

          banner: {
            file: {
              size: {
                max: CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max
              },
    Severity: Major
    Found in server/core/lib/server-config-manager.ts and 4 other locations - About 1 hr to fix
    server/core/controllers/misc.ts on lines 155..162
    server/core/controllers/misc.ts on lines 174..181
    server/core/lib/server-config-manager.ts on lines 231..238
    server/core/lib/server-config-manager.ts on lines 258..265

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

    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

            videoCaption: {
              file: {
                size: {
                  max: CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.FILE_SIZE.max
                },
    Severity: Major
    Found in server/core/controllers/misc.ts and 4 other locations - About 1 hr to fix
    server/core/controllers/misc.ts on lines 155..162
    server/core/lib/server-config-manager.ts on lines 231..238
    server/core/lib/server-config-manager.ts on lines 239..246
    server/core/lib/server-config-manager.ts on lines 258..265

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

    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

            avatar: {
              file: {
                size: {
                  max: CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max
                },
    Severity: Major
    Found in server/core/controllers/misc.ts and 4 other locations - About 1 hr to fix
    server/core/controllers/misc.ts on lines 174..181
    server/core/lib/server-config-manager.ts on lines 231..238
    server/core/lib/server-config-manager.ts on lines 239..246
    server/core/lib/server-config-manager.ts on lines 258..265

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

    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

          videoCaption: {
            file: {
              size: {
                max: CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.FILE_SIZE.max
              },
    Severity: Major
    Found in server/core/lib/server-config-manager.ts and 4 other locations - About 1 hr to fix
    server/core/controllers/misc.ts on lines 155..162
    server/core/controllers/misc.ts on lines 174..181
    server/core/lib/server-config-manager.ts on lines 231..238
    server/core/lib/server-config-manager.ts on lines 239..246

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

    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

        return Promise.all([
          VideoPlaylistElementModel.count(countQuery),
          VideoPlaylistElementModel.findAll(findQuery)
        ]).then(([ total, data ]) => ({ total, data }))
    Severity: Major
    Found in server/core/models/video/video-playlist-element.ts and 3 other locations - About 1 hr to fix
    server/core/models/redundancy/video-redundancy.ts on lines 608..612
    server/core/models/video/video-share.ts on lines 183..186
    server/core/models/watched-words/watched-words-list.ts on lines 118..121

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

    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

      updateLive (videoId: number | string, liveUpdate: LiveVideoUpdate) {
        return this.authHttp
          .put(LiveVideoService.BASE_VIDEO_LIVE_URL + videoId, liveUpdate)
          .pipe(catchError(err => this.restExtractor.handleError(err)))
      }
    client/src/app/shared/shared-main/channel/video-channel.service.ts on lines 85..88
    client/src/app/shared/shared-users/user-admin.service.ts on lines 26..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 56.

    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

        return Promise.all([
          WatchedWordsListModel.count(query),
          WatchedWordsListModel.findAll(query)
        ]).then(([ total, data ]) => ({ total, data }))
    Severity: Major
    Found in server/core/models/watched-words/watched-words-list.ts and 3 other locations - About 1 hr to fix
    server/core/models/redundancy/video-redundancy.ts on lines 608..612
    server/core/models/video/video-playlist-element.ts on lines 166..169
    server/core/models/video/video-share.ts on lines 183..186

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

    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

        return Promise.all([
          VideoModel.findAll(findOptions),
    
          VideoModel.count(countOptions)
        ]).then(([ data, total ]) => ({ total, data }))
    Severity: Major
    Found in server/core/models/redundancy/video-redundancy.ts and 3 other locations - About 1 hr to fix
    server/core/models/video/video-playlist-element.ts on lines 166..169
    server/core/models/video/video-share.ts on lines 183..186
    server/core/models/watched-words/watched-words-list.ts on lines 118..121

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

    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

      protected async createJobs (options: {
        video: MVideo
        payloads: [ [ Payload ], ...(Payload[][]) ] // Array of sequential jobs to create that depend on parent job
        user: MUserId | null
      }): Promise<void> {
    server/core/lib/transcoding/shared/job-builders/abstract-job-builder.ts on lines 260..264
    server/core/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts on lines 32..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 56.

    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

      protected async createJobs (options: {
        video: MVideo
        payloads: [ [ Payload ], ...(Payload[][]) ] // Array of sequential jobs to create that depend on parent job
        user: MUserId | null
      }): Promise<void> {
    server/core/lib/transcoding/shared/job-builders/abstract-job-builder.ts on lines 260..264
    server/core/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts on lines 23..53

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

    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