dalexhd/SteamSpeak

View on GitHub

Showing 97 of 107 total issues

Function changePosition has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    changePosition(elx, content, conditional) {
        let topx = 0;
        let leftx = 0;
        let widthx = 0;
        const scrollTopx = window.pageYOffset || document.documentElement.scrollTop;
Severity: Minor
Found in packages/client/src/assets/utils/index.js - About 1 hr to fix

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

    export default {
        client_not_found: 'El cliente especificado no se encuentra en el servidor.',
        ip_not_connected: 'No hay existe cliente que coincida con tu IP del navegador.',
        unexpected_error:
            'Ha habido un error inesperado. Por favor inténtalo de nuevo más tarde o contacta con un administrador',
    Severity: Major
    Found in packages/server/src/locales/es/error.ts and 3 other locations - About 55 mins to fix
    packages/server/src/locales/en/error.ts on lines 1..14
    packages/server/src/locales/en/steam/status.ts on lines 13..24
    packages/server/src/locales/es/steam/status.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 54.

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

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

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

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

    Refactorings

    Further Reading

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

    export default {
        [Offline]: 'Offline',
        [Online]: 'Online',
        [Busy]: 'Busy',
        [Away]: 'Away',
    Severity: Major
    Found in packages/server/src/locales/en/steam/status.ts and 3 other locations - About 55 mins to fix
    packages/server/src/locales/en/error.ts on lines 1..14
    packages/server/src/locales/es/error.ts on lines 1..14
    packages/server/src/locales/es/steam/status.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 54.

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

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

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

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

    Refactorings

    Further Reading

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

    export default {
        [Offline]: 'Desconectado',
        [Online]: 'Conectado',
        [Busy]: 'Ocupado',
        [Away]: 'Ausente',
    Severity: Major
    Found in packages/server/src/locales/es/steam/status.ts and 3 other locations - About 55 mins to fix
    packages/server/src/locales/en/error.ts on lines 1..14
    packages/server/src/locales/en/steam/status.ts on lines 13..24
    packages/server/src/locales/es/error.ts on lines 1..14

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

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

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

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

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

    Refactorings

    Further Reading

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

    export default {
        client_not_found: 'The specified client was not found on the server.',
        ip_not_connected: 'There are not users matching your ip address.',
        unexpected_error: 'There has been an unexpected error during the request.',
        unexpected_verification_error:
    Severity: Major
    Found in packages/server/src/locales/en/error.ts and 3 other locations - About 55 mins to fix
    packages/server/src/locales/en/steam/status.ts on lines 13..24
    packages/server/src/locales/es/error.ts on lines 1..14
    packages/server/src/locales/es/steam/status.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 54.

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

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

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

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

    Refactorings

    Further Reading

    Function drawTextWithEmoji has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        fillType: string,
        text: string,
        x: number,
        y: number,
        maxWidth?: number,
    Severity: Major
    Found in packages/server/src/utils/canvas/custom.ts - About 50 mins to fix

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

              Ts3.channelEdit(channel.channelId, channel.changes[key])
                  .then(async () => {
                      log.info(
                          `${info.name} ch[id: ${channel.channelId}] to: ${channel.changes[key].channelName}`,
                          'ts3'
      packages/server/src/core/TeamSpeak/plugins/first-instance/multi_function.ts on lines 23..31
      packages/server/src/core/TeamSpeak/plugins/second-instance/afk_move.ts on lines 15..26

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

      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

              Ts3.channelEdit(channel.channelId, {
                  channelName: name
              })
                  .then(() => {
                      log.info(`${info.name} ch[id: ${channel.channelId}] to: ${name}`, { type: 'ts3' });
      packages/server/src/core/TeamSpeak/plugins/second-instance/afk_move.ts on lines 15..26
      packages/server/src/core/TeamSpeak/plugins/second-instance/change_channel.ts on lines 11..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 51.

      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

                  client
                      .move(data.dest)
                      .then(() => {
                          client.poke('You have been moved to an AFK channel!');
                          log.info(
      packages/server/src/core/TeamSpeak/plugins/first-instance/multi_function.ts on lines 23..31
      packages/server/src/core/TeamSpeak/plugins/second-instance/change_channel.ts on lines 11..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 51.

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

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

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

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

      Refactorings

      Further Reading

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

          try {
              const steamData = await findSecret(req);
              const [client] = await findClients(req, {
                  clientType: 0,
                  clientDatabaseId: req.body.dbid
      Severity: Major
      Found in packages/server/src/core/Website/api/controllers/verify.ts and 3 other locations - About 45 mins to fix
      packages/server/src/core/Website/api/controllers/logs.ts on lines 13..33
      packages/server/src/core/Website/api/controllers/verify.ts on lines 32..43
      packages/server/src/core/Website/api/controllers/verify.ts on lines 57..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 50.

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

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

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

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

      Refactorings

      Further Reading

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

          try {
              const decoded = jwt.verify(req.token, config.jwt.secret) as { uid: string };
              const client = await Ts3.getClientByUid(decoded.uid);
              return res.status(200).json({ userData: client });
          } catch (error) {
      Severity: Major
      Found in packages/server/src/core/Website/api/controllers/auth.ts and 4 other locations - About 45 mins to fix
      packages/server/src/core/Website/api/controllers/auth.ts on lines 69..83
      packages/server/src/core/Website/api/controllers/auth.ts on lines 95..126
      packages/server/src/core/Website/api/controllers/auth.ts on lines 138..170
      packages/server/src/core/Website/api/controllers/auth.ts on lines 201..215

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

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

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

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

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

      Refactorings

      Further Reading

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

          try {
              const [client] = await findClients(
                  req,
                  {
                      clientType: 0,
      Severity: Major
      Found in packages/server/src/core/Website/api/controllers/auth.ts and 4 other locations - About 45 mins to fix
      packages/server/src/core/Website/api/controllers/auth.ts on lines 69..83
      packages/server/src/core/Website/api/controllers/auth.ts on lines 138..170
      packages/server/src/core/Website/api/controllers/auth.ts on lines 181..190
      packages/server/src/core/Website/api/controllers/auth.ts on lines 201..215

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

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

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

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

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

      Refactorings

      Further Reading

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

          try {
              const steamData = await findSecret(req);
              const [client] = await findClients(req, {
                  clientType: 0,
                  clientDatabaseId: req.body.dbid
      Severity: Major
      Found in packages/server/src/core/Website/api/controllers/verify.ts and 3 other locations - About 45 mins to fix
      packages/server/src/core/Website/api/controllers/logs.ts on lines 13..33
      packages/server/src/core/Website/api/controllers/verify.ts on lines 32..43
      packages/server/src/core/Website/api/controllers/verify.ts on lines 100..138

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

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

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

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

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

      Refactorings

      Further Reading

      Function checkDescriptionBanner has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      const checkDescriptionBanner = async (
          client: TeamSpeakClient | undefined,
          presenceString: string | undefined,
          data: SteamUser.PersonaData,
          steamId: string
      Severity: Minor
      Found in packages/server/src/core/Steam/modules/richPresence.ts - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          try {
              const [client] = await findClients(
                  req,
                  {
                      clientType: 0,
      Severity: Major
      Found in packages/server/src/core/Website/api/controllers/auth.ts and 4 other locations - About 45 mins to fix
      packages/server/src/core/Website/api/controllers/auth.ts on lines 69..83
      packages/server/src/core/Website/api/controllers/auth.ts on lines 95..126
      packages/server/src/core/Website/api/controllers/auth.ts on lines 181..190
      packages/server/src/core/Website/api/controllers/auth.ts on lines 201..215

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

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

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

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

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

      Refactorings

      Further Reading

      Function vsfunction has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          vsfunction(json) {
              for (const clave in json) {
                  if (Object.prototype.hasOwnProperty.call(json, clave)) {
                      let colorx;
                      if (/^[rgb(]/g.test(json[clave])) {
      Severity: Minor
      Found in packages/client/src/assets/utils/theme.js - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function authenticate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export const authenticate = async function (
          req: Request,
          res: Response,
          next: NextFunction
      ): Promise<any> {
      Severity: Minor
      Found in packages/server/src/core/Website/api/middlewares/authentication.ts - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          try {
              const clients = await findClients(
                  req,
                  {
                      clientType: 0
      Severity: Major
      Found in packages/server/src/core/Website/api/controllers/auth.ts and 4 other locations - About 45 mins to fix
      packages/server/src/core/Website/api/controllers/auth.ts on lines 95..126
      packages/server/src/core/Website/api/controllers/auth.ts on lines 138..170
      packages/server/src/core/Website/api/controllers/auth.ts on lines 181..190
      packages/server/src/core/Website/api/controllers/auth.ts on lines 201..215

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

      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

      Method component has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def component
          return @component if defined?(@component)
      
          component_name = name.split(" ").first
      
      
      Severity: Minor
      Found in scripts/util/metadata/commit_scope.rb - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          try {
              const decoded = jwt.verify(req.token, config.jwt.secret) as { uid: string };
              const client = (await Ts3.getClientByUid(decoded.uid)) as TeamSpeakClient;
              const accessToken = createToken(client.uniqueIdentifier);
              return res.status(200).json({
      Severity: Major
      Found in packages/server/src/core/Website/api/controllers/auth.ts and 4 other locations - About 45 mins to fix
      packages/server/src/core/Website/api/controllers/auth.ts on lines 69..83
      packages/server/src/core/Website/api/controllers/auth.ts on lines 95..126
      packages/server/src/core/Website/api/controllers/auth.ts on lines 138..170
      packages/server/src/core/Website/api/controllers/auth.ts on lines 181..190

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

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

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

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

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

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language