RocketChat/Rocket.Chat

View on GitHub
apps/meteor/server/settings/file-upload.ts

Summary

Maintainability
D
2 days
Test Coverage

Function createFileUploadSettings has 290 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    settingsRegistry.addGroup('FileUpload', async function () {
        await this.add('FileUpload_Enabled', true, {
            type: 'boolean',
            public: true,
        });
Severity: Major
Found in apps/meteor/server/settings/file-upload.ts - About 1 day to fix

    File file-upload.ts has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { settingsRegistry } from '../../app/settings/server';
    
    export const createFileUploadSettings = () =>
        settingsRegistry.addGroup('FileUpload', async function () {
            await this.add('FileUpload_Enabled', true, {
    Severity: Minor
    Found in apps/meteor/server/settings/file-upload.ts - About 3 hrs to fix

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

                  values: [
                      {
                          key: 'GridFS',
                          i18nLabel: 'GridFS',
                      },
      Severity: Major
      Found in apps/meteor/server/settings/file-upload.ts and 4 other locations - About 1 hr to fix
      apps/meteor/ee/app/livechat-enterprise/server/settings.ts on lines 315..321
      apps/meteor/ee/server/settings/ldap.ts on lines 34..55
      apps/meteor/server/settings/crowd.ts on lines 38..59
      ee/packages/pdf-worker/src/templates/ChatTranscript/ChatTranscript.fixtures.ts on lines 51..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 66.

      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

                  await this.add('FileUpload_S3_AWSAccessKeyId', '', {
                      type: 'password',
                      autocomplete: false,
                      secret: true,
                      i18nLabel: 'FileUpload_S3_AWSAccessKeyId',
      Severity: Major
      Found in apps/meteor/server/settings/file-upload.ts and 1 other location - About 1 hr to fix
      apps/meteor/server/settings/file-upload.ts on lines 120..130

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

      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

                  await this.add('FileUpload_S3_AWSSecretAccessKey', '', {
                      type: 'password',
                      autocomplete: false,
                      secret: true,
                      i18nLabel: 'FileUpload_S3_AWSSecretAccessKey',
      Severity: Major
      Found in apps/meteor/server/settings/file-upload.ts and 1 other location - About 1 hr to fix
      apps/meteor/server/settings/file-upload.ts on lines 109..119

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

      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

                  await this.add('FileUpload_GoogleStorage_Secret', '', {
                      type: 'string',
                      multiline: true,
                      private: true,
                      enableQuery: {
      Severity: Minor
      Found in apps/meteor/server/settings/file-upload.ts and 1 other location - About 50 mins to fix
      apps/meteor/server/settings/file-upload.ts on lines 222..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 52.

      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

                  await this.add('FileUpload_GoogleStorage_ProjectId', '', {
                      type: 'string',
                      multiline: false,
                      private: true,
                      enableQuery: {
      Severity: Minor
      Found in apps/meteor/server/settings/file-upload.ts and 1 other location - About 50 mins to fix
      apps/meteor/server/settings/file-upload.ts on lines 211..220

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

      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

                  await this.add('FileUpload_Webdav_Password', '', {
                      type: 'password',
                      private: true,
                      enableQuery: {
                          _id: 'FileUpload_Storage_Type',
      Severity: Minor
      Found in apps/meteor/server/settings/file-upload.ts and 2 other locations - About 35 mins to fix
      apps/meteor/server/settings/file-upload.ts on lines 193..201
      apps/meteor/server/settings/file-upload.ts on lines 202..210

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

                  await this.add('FileUpload_GoogleStorage_Bucket', '', {
                      type: 'string',
                      private: true,
                      enableQuery: {
                          _id: 'FileUpload_Storage_Type',
      Severity: Minor
      Found in apps/meteor/server/settings/file-upload.ts and 2 other locations - About 35 mins to fix
      apps/meteor/server/settings/file-upload.ts on lines 202..210
      apps/meteor/server/settings/file-upload.ts on lines 282..290

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

                  await this.add('FileUpload_GoogleStorage_AccessId', '', {
                      type: 'string',
                      private: true,
                      enableQuery: {
                          _id: 'FileUpload_Storage_Type',
      Severity: Minor
      Found in apps/meteor/server/settings/file-upload.ts and 2 other locations - About 35 mins to fix
      apps/meteor/server/settings/file-upload.ts on lines 193..201
      apps/meteor/server/settings/file-upload.ts on lines 282..290

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

              await this.add('FileUpload_json_web_token_secret_for_files', '', {
                  type: 'string',
                  i18nLabel: 'FileUpload_json_web_token_secret_for_files',
                  i18nDescription: 'FileUpload_json_web_token_secret_for_files_description',
                  enableQuery: {
      Severity: Minor
      Found in apps/meteor/server/settings/file-upload.ts and 1 other location - About 35 mins to fix
      apps/meteor/server/settings/slackbridge.ts on lines 173..181

      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