RocketChat/Rocket.Chat

View on GitHub
packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts

Summary

Maintainability
F
3 days
Test Coverage

RocketchatSdkLegacyImpl has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

export class RocketchatSdkLegacyImpl extends DDPSDK implements RocketchatSDKLegacy {
    private ev = new Emitter<RocketchatSdkLegacyEvents>();

    get url(): string {
        return this.connection.url;
Severity: Minor
Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts - About 3 hrs to fix

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

        get users() {
            const self = this;
            return {
                all(fields?: { name: 1; username: 1; status: 1; type: 1 }): Promise<Serialized<OperationResult<'GET', '/v1/users.list'>>> {
                    return self.rest.get('/v1/users.list', { fields: JSON.stringify(fields) });
    Severity: Minor
    Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts - About 1 hr to fix

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

                  onlineNames(): Promise<Serialized<OperationResult<'GET', '/v1/users.list'>>> {
                      return self.rest.get('/v1/users.list', {
                          fields: JSON.stringify({ name: 1 }),
                          query: JSON.stringify({ status: { $ne: 'offline' } }),
                      });
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 3 hrs to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 80..85

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 96.

      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

                  onlineIds(): Promise<Serialized<OperationResult<'GET', '/v1/users.list'>>> {
                      return self.rest.get('/v1/users.list', {
                          fields: JSON.stringify({ _id: 1 }),
                          query: JSON.stringify({ status: { $ne: 'offline' } }),
                      });
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 3 hrs to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 74..79

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

      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

          channelInfo(args: { roomName: string } | { roomId: string }): Promise<Serialized<OperationResult<'GET', '/v1/channels.info'>>> {
              return this.rest.get('/v1/channels.info', args);
          }
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 2 hrs to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 143..145

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

      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

          privateInfo(args: { roomName: string } | { roomId: string }): Promise<Serialized<OperationResult<'GET', '/v1/groups.info'>>> {
              return this.rest.get('/v1/groups.info', args);
          }
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 2 hrs to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 139..141

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

      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

                  allNames(): Promise<Serialized<OperationResult<'GET', '/v1/users.list'>>> {
                      return self.rest.get('/v1/users.list', { fields: JSON.stringify({ name: 1 }) });
                  },
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 68..70

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 71.

      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

                  allIDs(): Promise<Serialized<OperationResult<'GET', '/v1/users.list'>>> {
                      return self.rest.get('/v1/users.list', { fields: JSON.stringify({ _id: 1 }) });
                  },
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 65..67

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 71.

      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

                  leave: (rid: string): Promise<Serialized<OperationResult<'POST', '/v1/channels.leave'>>> => {
                      return self.rest.post('/v1/channels.leave', { roomId: rid });
                  },
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 106..108

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

      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

                  join: (rid: string): Promise<Serialized<OperationResult<'POST', '/v1/channels.join'>>> => {
                      return self.rest.post('/v1/channels.join', { roomId: rid });
                  },
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 112..114

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

      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

                  info(username: string): Promise<Serialized<OperationResult<'GET', '/v1/users.info'>>> {
                      return self.rest.get('/v1/users.info', { username });
                  },
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 133..135

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

      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

          createDirectMessage(username: string): Promise<Serialized<OperationResult<'POST', '/v1/im.create'>>> {
              return this.rest.post('/v1/im.create', { username });
          }
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 126..128

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

      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

                  create(username: string): Promise<Serialized<OperationResult<'POST', '/v1/im.create'>>> {
                      return self.rest.post('/v1/im.create', { username });
                  },
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 86..88

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

      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

          leaveRoom(rid: string): Promise<Serialized<OperationResult<'POST', '/v1/channels.leave'>>> {
              return this.rest.post('/v1/channels.leave', { roomId: rid });
          }
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 1 other location - About 1 hr to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 155..157

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

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

                  this.stream('notify-user', `${this.account.uid}/message`, (...args) => this.ev.emit('user-message', args)),
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 6 other locations - About 35 mins to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 227..227
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 228..228
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 229..229
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 230..230
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 231..231
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 232..232

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

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

                  this.stream('notify-user', `${this.account.uid}/subscriptions-changed`, (...args) => this.ev.emit('subscriptions-changed', args)),
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 6 other locations - About 35 mins to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 226..226
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 227..227
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 228..228
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 229..229
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 230..230
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 232..232

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

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

                  this.stream('notify-user', `${this.account.uid}/notification`, (...args) => this.ev.emit('notification', args)),
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 6 other locations - About 35 mins to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 226..226
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 227..227
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 228..228
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 230..230
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 231..231
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 232..232

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

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

                  this.stream('notify-user', `${this.account.uid}/rooms-changed`, (...args) => this.ev.emit('rooms-changed', args)),
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 6 other locations - About 35 mins to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 226..226
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 227..227
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 228..228
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 229..229
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 231..231
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 232..232

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

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

                  this.stream('notify-user', `${this.account.uid}/webrtc`, (...args) => this.ev.emit('webrtc', args)),
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 6 other locations - About 35 mins to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 226..226
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 227..227
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 229..229
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 230..230
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 231..231
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 232..232

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

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

                  this.stream('notify-user', `${this.account.uid}/otr`, (...args) => this.ev.emit('otr', args)),
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 6 other locations - About 35 mins to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 226..226
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 228..228
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 229..229
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 230..230
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 231..231
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 232..232

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

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

                  this.stream('notify-user', `${this.account.uid}/uiInteraction`, (...args) => this.ev.emit('uiInteraction', args)),
      Severity: Major
      Found in packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts and 6 other locations - About 35 mins to fix
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 226..226
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 227..227
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 228..228
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 229..229
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 230..230
      packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts on lines 231..231

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

      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

      There are no issues that match your filters.

      Category
      Status