department-of-veterans-affairs/vets-website

View on GitHub
src/platform/user/profile/vap-svc/util/local-vapsvc.js

Summary

Maintainability
F
6 days
Test Coverage

File local-vapsvc.js has 600 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { uniqueId } from 'lodash';
import * as VAP_SERVICE from '../constants';

export function isVAProfileServiceConfigured() {
  return (
Severity: Major
Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 day to fix

    Function addressValidationSuccess has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      addressValidationSuccess() {
        return asyncReturn(
          {
            addresses: [
              {
    Severity: Major
    Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 2 hrs to fix

      Function addressValidationSuccessTwoConfirmedSuggestions has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        addressValidationSuccessTwoConfirmedSuggestions() {
          return asyncReturn(
            {
              addresses: [
                {
      Severity: Minor
      Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

        Function addressValidationSuccessTwoInternational has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          addressValidationSuccessTwoInternational() {
            return asyncReturn(
              {
                addresses: [
                  {
        Severity: Minor
        Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

          Function addressValidationSuccessSingleBadUnitNumber has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            addressValidationSuccessSingleBadUnitNumber() {
              return asyncReturn(
                {
                  addresses: [
                    {
          Severity: Minor
          Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

            Function addressValidationSuccessSingleMissingUnitNumber has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              addressValidationSuccessSingleMissingUnitNumber() {
                return asyncReturn(
                  {
                    addresses: [
                      {
            Severity: Minor
            Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

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

                addressValidationSuccessSingleLowConfidenceSuggestion() {
                  return asyncReturn(
                    {
                      addresses: [
                        {
              Severity: Minor
              Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

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

                  addressValidationSuccessSingleConfirmedSuggestion() {
                    return asyncReturn(
                      {
                        addresses: [
                          {
                Severity: Minor
                Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

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

                    addressValidationSuccessSingleMissingUnitNumber() {
                      return asyncReturn(
                        {
                          addresses: [
                            {
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 234..262
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 375..403
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 434..463

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

                    addressValidationSuccessSingleConfirmedSuggestion() {
                      return asyncReturn(
                        {
                          addresses: [
                            {
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 375..403
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 404..433
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 434..463

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

                    addressValidationSuccessSingleBadUnitNumber() {
                      return asyncReturn(
                        {
                          addresses: [
                            {
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 234..262
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 375..403
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 404..433

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

                    addressValidationSuccessSingleLowConfidenceSuggestion() {
                      return asyncReturn(
                        {
                          addresses: [
                            {
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 234..262
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 404..433
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 434..463

                  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

                    temporaryPhone: {
                      areaCode: '503',
                      countryCode: '1',
                      createdAt: '2018-04-21T20:09:50Z',
                      effectiveEndDate: '2018-04-21T20:09:50Z',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 1 other location - About 2 hrs to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 43..60

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

                  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

                    homePhone: {
                      areaCode: '503',
                      countryCode: '1',
                      createdAt: '2018-04-21T20:09:50Z',
                      effectiveEndDate: '2018-04-21T20:09:50Z',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 1 other location - About 2 hrs to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 63..80

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

                  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: '575 20th Ave',
                                addressType: 'DOMESTIC',
                                city: 'San Francisco',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.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 564..583
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 584..604
                  src/applications/personalization/profile/msw-mocks.js on lines 571..590

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

                            {
                              address: {
                                addressLine1: '400 NE 65th St',
                                addressType: 'DOMESTIC',
                                city: 'Seattle',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.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/applications/personalization/profile/msw-mocks.js on lines 571..590

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

                            {
                              address: {
                                addressLine1: '575 20th St',
                                addressType: 'DOMESTIC',
                                city: 'San Francisco',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 4 other locations - About 2 hrs to fix
                  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
                  src/applications/personalization/profile/msw-mocks.js on lines 571..590

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

                            {
                              address: {
                                addressLine1: '400 NW 65th St',
                                addressType: 'DOMESTIC',
                                city: 'Seattle',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.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 584..604
                  src/applications/personalization/profile/msw-mocks.js on lines 571..590

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

                            {
                              address: {
                                addressLine1: 'Great Russell Street',
                                addressType: 'INTERNATIONAL',
                                city: 'London',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 2 other locations - About 55 mins to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 291..304
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 305..318

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

                            {
                              address: {
                                addressLine1: '123 Great Russell Street',
                                addressType: 'INTERNATIONAL',
                                city: 'London',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 2 other locations - About 55 mins to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 267..280
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 305..318

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

                            {
                              address: {
                                addressLine1: '456 Great Russell Street',
                                addressType: 'INTERNATIONAL',
                                city: 'London',
                  Severity: Major
                  Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 2 other locations - About 55 mins to fix
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 267..280
                  src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 291..304

                  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

                  There are no issues that match your filters.

                  Category
                  Status