RocketChat/Rocket.Chat

View on GitHub
apps/meteor/server/lib/oauth/addOAuthService.ts

Summary

Maintainability
F
1 wk
Test Coverage

Function addOAuthService has 256 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function addOAuthService(name: string, values: { [k: string]: string | boolean | undefined } = {}): Promise<void> {
    name = name.toLowerCase().replace(/[^a-z0-9_]/g, '');
    name = capitalize(name);
    await settingsRegistry.add(`Accounts_OAuth_Custom-${name}`, values.enabled || false, {
        type: 'boolean',
Severity: Major
Found in apps/meteor/server/lib/oauth/addOAuthService.ts - About 1 day to fix

    File addOAuthService.ts has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint no-multi-spaces: 0 */
    /* eslint comma-spacing: 0 */
    import { capitalize } from '@rocket.chat/string-helpers';
    
    import { settingsRegistry } from '../../../app/settings/server';
    Severity: Minor
    Found in apps/meteor/server/lib/oauth/addOAuthService.ts - About 2 hrs to fix

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-login_style`, values.loginStyle || 'popup', {
              type: 'select',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Login_Style',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 3 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 42..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 109.

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-identity_token_sent_via`, values.identityTokenSentVia || 'default', {
              type: 'select',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Identity_Token_Sent_Via',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 3 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 96..107

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-key_field`, values.keyField || 'username', {
              type: 'select',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Key_Field',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 3 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 31..41

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-token_sent_via`, values.tokenSentVia || 'payload', {
              type: 'select',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Token_Sent_Via',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 3 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 129..139

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-roles_claim`, values.rolesClaim || 'roles', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Roles_Claim',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 2 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 177..185

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-merge_roles`, values.mergeRoles || false, {
              type: 'boolean',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Merge_Roles',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 2 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 194..202

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-groups_claim`, values.groupsClaim || 'groups', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Groups_Claim',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 2 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 168..176

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-map_channels`, values.mapChannels || false, {
              type: 'boolean',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Map_Channels',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 2 hrs to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 203..211

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-channels_admin`, values.channelsAdmin || 'rocket.cat', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Channel_Admin',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-username_field`, values.usernameField || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Username_Field',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-id`, values.clientId || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_id',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-identity_path`, values.identityPath || '/me', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Identity_Path',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-avatar_field`, values.avatarField || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Avatar_Field',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-button_label_text`, values.buttonLabelText || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-token_path`, values.tokenPath || '/oauth/token', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Token_Path',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-scope`, values.scope || 'openid', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Scope',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-secret`, values.clientSecret || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Secret',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-button_label_color`, values.buttonLabelColor || '#FFFFFF', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-button_color`, values.buttonColor || '#1d74f5', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Button_Color',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-name_field`, values.nameField || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Name_Field',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-authorize_path`, values.authorizePath || '/oauth/authorize', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Authorize_Path',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-url`, values.serverURL || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'URL',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-email_field`, values.emailField || '', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Email_Field',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 75..81
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

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

          await settingsRegistry.add(`Accounts_OAuth_Custom-${name}-access_token_param`, values.accessTokenParam || 'access_token', {
              type: 'string',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Access_Token_Param',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 15 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 17..23
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 24..30
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 54..60
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 61..67
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 68..74
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 82..88
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 89..95
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 108..114
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 115..121
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 122..128
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 140..146
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 147..153
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 154..160
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 161..167
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 187..193

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-merge_users`, values.mergeUsers || false, {
              type: 'boolean',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Merge_Users',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 2 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 10..16
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 245..251

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-show_button`, values.showButton || true, {
              type: 'boolean',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Show_Button_On_Login_Page',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 2 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 10..16
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 226..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 67.

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}`, values.enabled || false, {
              type: 'boolean',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Enable',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 2 other locations - About 1 hr to fix
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 226..232
      apps/meteor/server/lib/oauth/addOAuthService.ts on lines 245..251

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

      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 settingsRegistry.add(`Accounts_OAuth_Custom-${name}-merge_users_distinct_services`, values.mergeUsersDistinctServices || false, {
              type: 'boolean',
              group: 'OAuth',
              section: `Custom OAuth: ${name}`,
              i18nLabel: 'Accounts_OAuth_Custom_Merge_Users_Distinct_Services',
      Severity: Major
      Found in apps/meteor/server/lib/oauth/addOAuthService.ts and 1 other location - About 1 hr to fix
      apps/meteor/server/startup/migrations/v300.ts on lines 13..24

      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

      There are no issues that match your filters.

      Category
      Status