department-of-veterans-affairs/vets-website

View on GitHub
src/applications/personalization/profile/msw-mocks.js

Summary

Maintainability
F
1 wk
Test Coverage

File msw-mocks.js has 782 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { rest } from 'msw';
import mockDisabilityCompensation from '@@profile/mocks/endpoints/disability-compensations';
import environment from '~/platform/utilities/environment';

import mockDD4CNPSuccess from './tests/fixtures/dd4cnp/dd4cnp-is-set-up.json';
Severity: Major
Found in src/applications/personalization/profile/msw-mocks.js - About 1 day to fix

    Function editPhoneNumberSuccess has 139 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const editPhoneNumberSuccess = () => {
      // store the phone number that's passed in via the POST or PUT call so we can
      // return it with the GET user/ response
      let newAreaCode;
      let newPhoneNumber;
    Severity: Major
    Found in src/applications/personalization/profile/msw-mocks.js - About 5 hrs to fix

      Function editEmailAddressSuccess has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const editEmailAddressSuccess = () => {
        // store the email address that's passed in via the POST or PUT call so we can
        // return it with the GET user/ response
        let newEmailAddress;
        return [
      Severity: Major
      Found in src/applications/personalization/profile/msw-mocks.js - About 3 hrs to fix

        Function toggleSMSNotificationsSuccess has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const toggleSMSNotificationsSuccess = (enrolled = true) => {
          return [
            rest.put(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
              return res(
                ctx.json({
        Severity: Major
        Found in src/applications/personalization/profile/msw-mocks.js - About 2 hrs to fix

          Function deletePhoneNumberSuccess has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const deletePhoneNumberSuccess = () => {
            return [
              rest.delete(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
                return res(
                  ctx.json({
          Severity: Minor
          Found in src/applications/personalization/profile/msw-mocks.js - About 1 hr to fix

            Function editAddressSuccess has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              rest.post(`${prefix}/v0/profile/address_validation`, (req, res, ctx) => {
                return res(
                  ctx.json({
                    addresses: [
                      {
            Severity: Minor
            Found in src/applications/personalization/profile/msw-mocks.js - About 1 hr to fix

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

                              mailingAddress: {
                                addressLine1: '8210 Doby Ln',
                                addressLine2: null,
                                addressLine3: null,
                                addressPou: 'CORRESPONDENCE',
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 2 other locations - About 5 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 637..665
              src/applications/personalization/profile/msw-mocks.js on lines 666..694

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

              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

                            mailingAddress: {
                              addressLine1: '123 Main St',
                              addressLine2: null,
                              addressLine3: null,
                              addressPou: 'CORRESPONDENCE',
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 2 other locations - About 5 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 277..305
              src/applications/personalization/profile/msw-mocks.js on lines 637..665

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

              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

                            residentialAddress: {
                              addressLine1: '123 Main St',
                              addressLine2: null,
                              addressLine3: null,
                              addressPou: 'RESIDENCE/CHOICE',
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 2 other locations - About 5 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 277..305
              src/applications/personalization/profile/msw-mocks.js on lines 666..694

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

              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

                              homePhone: {
                                areaCode: newAreaCode,
                                countryCode: '1',
                                createdAt: '2020-07-25T00:33:15.000Z',
                                extension: null,
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 3 other locations - About 3 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 415..435
              src/applications/personalization/profile/msw-mocks.js on lines 457..477
              src/applications/personalization/profile/msw-mocks.js on lines 479..499

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

              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

                              workPhone: {
                                areaCode: newAreaCode,
                                countryCode: '1',
                                createdAt: '2020-07-25T00:33:51.000Z',
                                extension: null,
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 3 other locations - About 3 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 415..435
              src/applications/personalization/profile/msw-mocks.js on lines 436..456
              src/applications/personalization/profile/msw-mocks.js on lines 479..499

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

              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

                              mobilePhone: {
                                areaCode: newAreaCode,
                                countryCode: '1',
                                createdAt: '2020-07-25T00:34:24.000Z',
                                extension: null,
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 3 other locations - About 3 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 436..456
              src/applications/personalization/profile/msw-mocks.js on lines 457..477
              src/applications/personalization/profile/msw-mocks.js on lines 479..499

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

              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

                              faxNumber: {
                                areaCode: newAreaCode,
                                countryCode: '1',
                                createdAt: '2020-07-31T20:54:34.000Z',
                                extension: null,
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 3 other locations - About 3 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 415..435
              src/applications/personalization/profile/msw-mocks.js on lines 436..456
              src/applications/personalization/profile/msw-mocks.js on lines 457..477

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

              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

                        {
                          address: {
                            addressLine1: '123 Main St',
                            addressType: 'DOMESTIC',
                            city: 'San Francisco',
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 4 other locations - About 2 hrs to fix
              src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 329..348
              src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 349..368
              src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 564..583
              src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 584..604

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

              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

                  rest.put(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
                    newAreaCode = req.body.areaCode;
                    newPhoneNumber = req.body.phoneNumber;
                    return res(
                      ctx.json({
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 1 other location - About 2 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 370..378

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

              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

                  rest.post(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
                    newAreaCode = req.body.areaCode;
                    newPhoneNumber = req.body.phoneNumber;
                    return res(
                      ctx.json({
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 1 other location - About 2 hrs to fix
              src/applications/personalization/profile/msw-mocks.js on lines 379..387

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

              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

                  rest.post(`${prefix}/v0/profile/email_addresses`, (req, res, ctx) => {
                    newEmailAddress = req.body.emailAddress;
                    return res(
                      ctx.json({
                        data: createTransactionRequestSuccessBody,
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 1 other location - About 1 hr to fix
              src/applications/personalization/profile/msw-mocks.js on lines 232..239

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

              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

                  rest.put(`${prefix}/v0/profile/email_addresses`, (req, res, ctx) => {
                    newEmailAddress = req.body.emailAddress;
                    return res(
                      ctx.json({
                        data: createTransactionRequestSuccessBody,
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 1 other location - About 1 hr to fix
              src/applications/personalization/profile/msw-mocks.js on lines 224..231

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 63.

              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

                rest.delete(`${prefix}/v0/profile/*`, (req, res, ctx) => {
                  return res(
                    ctx.status(400),
                    ctx.json({
                      // response pulled from vets-api config/locales/exceptions.en.yml
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 2 other locations - About 1 hr to fix
              src/applications/personalization/profile/msw-mocks.js on lines 97..105
              src/applications/personalization/profile/msw-mocks.js on lines 106..114

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 61.

              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

                rest.put(`${prefix}/v0/profile/*`, (req, res, ctx) => {
                  return res(
                    ctx.status(400),
                    ctx.json({
                      // response pulled from vets-api config/locales/exceptions.en.yml
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 2 other locations - About 1 hr to fix
              src/applications/personalization/profile/msw-mocks.js on lines 97..105
              src/applications/personalization/profile/msw-mocks.js on lines 115..123

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

              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

                rest.post(`${prefix}/v0/profile/*`, (req, res, ctx) => {
                  return res(
                    ctx.status(400),
                    ctx.json({
                      // response pulled from vets-api config/locales/exceptions.en.yml
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 2 other locations - About 1 hr to fix
              src/applications/personalization/profile/msw-mocks.js on lines 106..114
              src/applications/personalization/profile/msw-mocks.js on lines 115..123

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

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

                rest.put(`${prefix}/v0/profile/addresses`, (req, res, ctx) => {
                  return res(
                    ctx.json({
                      data: createTransactionRequestSuccessBody,
                    }),
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 5 other locations - About 40 mins to fix
              src/applications/personalization/profile/msw-mocks.js on lines 320..326
              src/applications/personalization/profile/msw-mocks.js on lines 516..522
              src/applications/personalization/profile/msw-mocks.js on lines 596..602
              src/applications/personalization/profile/msw-mocks.js on lines 708..714
              src/applications/personalization/profile/msw-mocks.js on lines 752..758

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

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

                  rest.delete(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
                    return res(
                      ctx.json({
                        data: createTransactionRequestSuccessBody,
                      }),
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 5 other locations - About 40 mins to fix
              src/applications/personalization/profile/msw-mocks.js on lines 320..326
              src/applications/personalization/profile/msw-mocks.js on lines 596..602
              src/applications/personalization/profile/msw-mocks.js on lines 603..609
              src/applications/personalization/profile/msw-mocks.js on lines 708..714
              src/applications/personalization/profile/msw-mocks.js on lines 752..758

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

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

                rest.delete(`${prefix}/v0/profile/email_addresses`, (req, res, ctx) => {
                  return res(
                    ctx.json({
                      data: createTransactionRequestSuccessBody,
                    }),
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 5 other locations - About 40 mins to fix
              src/applications/personalization/profile/msw-mocks.js on lines 516..522
              src/applications/personalization/profile/msw-mocks.js on lines 596..602
              src/applications/personalization/profile/msw-mocks.js on lines 603..609
              src/applications/personalization/profile/msw-mocks.js on lines 708..714
              src/applications/personalization/profile/msw-mocks.js on lines 752..758

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

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

                  rest.put(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
                    return res(
                      ctx.json({
                        data: createTransactionRequestSuccessBody,
                      }),
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 5 other locations - About 40 mins to fix
              src/applications/personalization/profile/msw-mocks.js on lines 320..326
              src/applications/personalization/profile/msw-mocks.js on lines 516..522
              src/applications/personalization/profile/msw-mocks.js on lines 596..602
              src/applications/personalization/profile/msw-mocks.js on lines 603..609
              src/applications/personalization/profile/msw-mocks.js on lines 708..714

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

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

                rest.post(`${prefix}/v0/profile/addresses`, (req, res, ctx) => {
                  return res(
                    ctx.json({
                      data: createTransactionRequestSuccessBody,
                    }),
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 5 other locations - About 40 mins to fix
              src/applications/personalization/profile/msw-mocks.js on lines 320..326
              src/applications/personalization/profile/msw-mocks.js on lines 516..522
              src/applications/personalization/profile/msw-mocks.js on lines 603..609
              src/applications/personalization/profile/msw-mocks.js on lines 708..714
              src/applications/personalization/profile/msw-mocks.js on lines 752..758

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

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

                rest.delete(`${prefix}/v0/profile/addresses`, (req, res, ctx) => {
                  return res(
                    ctx.json({
                      data: createTransactionRequestSuccessBody,
                    }),
              Severity: Major
              Found in src/applications/personalization/profile/msw-mocks.js and 5 other locations - About 40 mins to fix
              src/applications/personalization/profile/msw-mocks.js on lines 320..326
              src/applications/personalization/profile/msw-mocks.js on lines 516..522
              src/applications/personalization/profile/msw-mocks.js on lines 596..602
              src/applications/personalization/profile/msw-mocks.js on lines 603..609
              src/applications/personalization/profile/msw-mocks.js on lines 752..758

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

              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