Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

VideoStatsComponent has 30 functions (exceeds 20 allowed). Consider refactoring.
Open

@Component({
  templateUrl: './video-stats.component.html',
  styleUrls: [ './video-stats.component.scss' ],
  providers: [ NumberFormatterPipe ],
  standalone: true,
Severity: Minor
Found in client/src/app/+stats/video/video-stats.component.ts - About 3 hrs to fix

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

        this.userAdminService.unbanUsers(users)
            .subscribe({
              next: () => {
                this.notifier.success(
                  formatICU(
    client/src/app/+admin/overview/users/user-list/user-list.component.ts on lines 293..307

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

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

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

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

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

    Refactorings

    Further Reading

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

        this.userAdminService.removeUsers(users)
          .subscribe({
            next: () => {
              this.notifier.success(
                formatICU(
    client/src/app/+admin/overview/users/user-list/user-list.component.ts on lines 264..277

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

    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

        this.adminRegistrationService.removeRegistrations(registrations)
          .subscribe({
            next: () => {
              // eslint-disable-next-line max-len
              const message = formatICU(
    client/src/app/+admin/follows/followers-list/followers-list.component.ts on lines 142..157
    client/src/app/+admin/follows/following-list/following-list.component.ts on lines 97..111

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

    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 videosRoutes: Routes = [
      {
        path: 'videos',
        canActivate: [ UserRightGuard ],
        data: {
    Severity: Major
    Found in client/src/app/+admin/overview/videos/video.routes.ts and 2 other locations - About 3 hrs to fix
    client/src/app/+admin/config/config.routes.ts on lines 6..30
    client/src/app/+admin/overview/comments/video-comment.routes.ts on lines 6..30

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

    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 commentRoutes: Routes = [
      {
        path: 'comments',
        canActivate: [ UserRightGuard ],
        data: {
    client/src/app/+admin/config/config.routes.ts on lines 6..30
    client/src/app/+admin/overview/videos/video.routes.ts on lines 6..30

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

    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

        this.followService.removeFollower(follows)
            .subscribe({
              next: () => {
                // eslint-disable-next-line max-len
                const message = formatICU(
    client/src/app/+admin/follows/following-list/following-list.component.ts on lines 97..111
    client/src/app/+admin/moderation/registration-list/registration-list.component.ts on lines 155..169

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

    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

        this.followService.unfollow(follows)
          .subscribe({
            next: () => {
              // eslint-disable-next-line max-len
              const message = formatICU(
    client/src/app/+admin/follows/followers-list/followers-list.component.ts on lines 142..157
    client/src/app/+admin/moderation/registration-list/registration-list.component.ts on lines 155..169

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

    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 ConfigRoutes: Routes = [
      {
        path: 'config',
        canActivate: [ UserRightGuard ],
        data: {
    Severity: Major
    Found in client/src/app/+admin/config/config.routes.ts and 2 other locations - About 3 hrs to fix
    client/src/app/+admin/overview/comments/video-comment.routes.ts on lines 6..30
    client/src/app/+admin/overview/videos/video.routes.ts on lines 6..30

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

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

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

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

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

    Refactorings

    Further Reading

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

              this.videoService.removeVideo(abuse.video.id)
                .subscribe({
                  next: () => {
                    this.notifier.success($localize`Video deleted.`)
    
    
    client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts on lines 404..413

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

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

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

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

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

    Refactorings

    Further Reading

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

    async function removeHLSPlaylistController (req: express.Request, res: express.Response) {
      const video = res.locals.videoAll
    
      logger.info('Deleting HLS playlist of %s.', video.url, lTags(video.uuid))
      await removeHLSPlaylist(video)
    Severity: Major
    Found in server/core/controllers/api/videos/files.ts and 1 other location - About 3 hrs to fix
    server/core/controllers/api/videos/files.ts on lines 101..110

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

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

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

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

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

    Refactorings

    Further Reading

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

              this.videoBlocklistService.unblockVideo(abuse.video.id)
                .subscribe({
                  next: () => {
                    this.notifier.success($localize`Video unblocked.`)
    
    
    client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts on lines 426..435

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

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

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

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

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

    Refactorings

    Further Reading

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

    async function removeAllWebVideoFilesController (req: express.Request, res: express.Response) {
      const video = res.locals.videoAll
    
      logger.info('Deleting Web Video files of %s.', video.url, lTags(video.uuid))
    
    
    Severity: Major
    Found in server/core/controllers/api/videos/files.ts and 1 other location - About 3 hrs to fix
    server/core/controllers/api/videos/files.ts on lines 74..83

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

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

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

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

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

    Refactorings

    Further Reading

    Function buildAbuseListQuery has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    function buildAbuseListQuery (options: BuildAbusesQueryOptions, type: 'count' | 'id') {
      const whereAnd: string[] = []
      const replacements: any = {}
    
      const joins = [
    Severity: Minor
    Found in server/core/models/abuse/sql/abuse-query-builder.ts - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function up has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    async function up (utils: {
      transaction: Sequelize.Transaction
      queryInterface: Sequelize.QueryInterface
      sequelize: Sequelize.Sequelize
    }): Promise<void> {
    Severity: Major
    Found in server/core/initializers/migrations/0845-auto-tags.ts - About 3 hrs to fix

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

        notifyOnVideoPublishedAfterTranscoding (video: MVideoFullLight): void {
          const models = this.notificationModels.publicationAfterTranscoding
      
          logger.debug('Notify on published video after transcoding', { video: video.url, ...lTags() })
      
      
      Severity: Major
      Found in server/core/lib/notifier/notifier.ts and 8 other locations - About 3 hrs to fix
      server/core/lib/notifier/notifier.ts on lines 83..90
      server/core/lib/notifier/notifier.ts on lines 101..108
      server/core/lib/notifier/notifier.ts on lines 121..128
      server/core/lib/notifier/notifier.ts on lines 130..137
      server/core/lib/notifier/notifier.ts on lines 166..173
      server/core/lib/notifier/notifier.ts on lines 186..193
      server/core/lib/notifier/notifier.ts on lines 195..202
      server/core/lib/notifier/notifier.ts on lines 236..243

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

      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

        notifyOnNewVideoOrLiveIfNeeded (video: MVideoAccountLight): void {
          const models = this.notificationModels.newVideoOrLive
      
          logger.debug('Notify on new video or live if needed', { video: video.url, ...lTags() })
      
      
      Severity: Major
      Found in server/core/lib/notifier/notifier.ts and 8 other locations - About 3 hrs to fix
      server/core/lib/notifier/notifier.ts on lines 92..99
      server/core/lib/notifier/notifier.ts on lines 101..108
      server/core/lib/notifier/notifier.ts on lines 121..128
      server/core/lib/notifier/notifier.ts on lines 130..137
      server/core/lib/notifier/notifier.ts on lines 166..173
      server/core/lib/notifier/notifier.ts on lines 186..193
      server/core/lib/notifier/notifier.ts on lines 195..202
      server/core/lib/notifier/notifier.ts on lines 236..243

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

      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

        notifyOnVideoPublishedAfterScheduledUpdate (video: MVideoFullLight): void {
          const models = this.notificationModels.publicationAfterScheduleUpdate
      
          logger.debug('Notify on published video after scheduled update', { video: video.url, ...lTags() })
      
      
      Severity: Major
      Found in server/core/lib/notifier/notifier.ts and 8 other locations - About 3 hrs to fix
      server/core/lib/notifier/notifier.ts on lines 83..90
      server/core/lib/notifier/notifier.ts on lines 92..99
      server/core/lib/notifier/notifier.ts on lines 121..128
      server/core/lib/notifier/notifier.ts on lines 130..137
      server/core/lib/notifier/notifier.ts on lines 166..173
      server/core/lib/notifier/notifier.ts on lines 186..193
      server/core/lib/notifier/notifier.ts on lines 195..202
      server/core/lib/notifier/notifier.ts on lines 236..243

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

      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

        notifyOnNewDirectRegistration (user: MUserDefault): void {
          const models = this.notificationModels.directRegistration
      
          logger.debug('Notify on new direct registration', { user: user.username, ...lTags() })
      
      
      Severity: Major
      Found in server/core/lib/notifier/notifier.ts and 8 other locations - About 3 hrs to fix
      server/core/lib/notifier/notifier.ts on lines 83..90
      server/core/lib/notifier/notifier.ts on lines 92..99
      server/core/lib/notifier/notifier.ts on lines 101..108
      server/core/lib/notifier/notifier.ts on lines 121..128
      server/core/lib/notifier/notifier.ts on lines 130..137
      server/core/lib/notifier/notifier.ts on lines 166..173
      server/core/lib/notifier/notifier.ts on lines 195..202
      server/core/lib/notifier/notifier.ts on lines 236..243

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

      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

        notifyOnNewRegistrationRequest (registration: MRegistration): void {
          const models = this.notificationModels.registrationRequest
      
          logger.debug('Notify on new registration request', { registration: registration.username, ...lTags() })
      
      
      Severity: Major
      Found in server/core/lib/notifier/notifier.ts and 8 other locations - About 3 hrs to fix
      server/core/lib/notifier/notifier.ts on lines 83..90
      server/core/lib/notifier/notifier.ts on lines 92..99
      server/core/lib/notifier/notifier.ts on lines 101..108
      server/core/lib/notifier/notifier.ts on lines 121..128
      server/core/lib/notifier/notifier.ts on lines 130..137
      server/core/lib/notifier/notifier.ts on lines 166..173
      server/core/lib/notifier/notifier.ts on lines 186..193
      server/core/lib/notifier/notifier.ts on lines 236..243

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

      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