department-of-veterans-affairs/vets-website

View on GitHub
src/applications/simple-forms/21-0966/config/helpers.js

Summary

Maintainability
F
3 days
Test Coverage

File helpers.js has 330 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { isEmpty } from 'lodash';
import { createInitialState } from '@department-of-veterans-affairs/platform-forms-system/state/helpers';
import { format } from 'date-fns';
import { apiRequest } from 'platform/utilities/api';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
Severity: Minor
Found in src/applications/simple-forms/21-0966/config/helpers.js - About 3 hrs to fix

    Function confirmationPageNextStepsParagraph has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const confirmationPageNextStepsParagraph = formData => {
      if (
        hasActiveCompensationITF({ formData }) &&
        hasActivePensionITF({ formData })
      ) {
    Severity: Minor
    Found in src/applications/simple-forms/21-0966/config/helpers.js - About 1 hr to fix

      Function confirmationPageNextStepsParagraph has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      export const confirmationPageNextStepsParagraph = formData => {
        if (
          hasActiveCompensationITF({ formData }) &&
          hasActivePensionITF({ formData })
        ) {
      Severity: Minor
      Found in src/applications/simple-forms/21-0966/config/helpers.js - About 1 hr 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 confirmationPageAlertParagraph has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const confirmationPageAlertParagraph = formData => {
        if (confirmationPageFormBypassed(formData)) {
          if (
            hasActiveCompensationITF({ formData }) &&
            hasActivePensionITF({ formData })
      Severity: Minor
      Found in src/applications/simple-forms/21-0966/config/helpers.js - About 1 hr to fix

        Function confirmationPageAlertParagraph has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export const confirmationPageAlertParagraph = formData => {
          if (confirmationPageFormBypassed(formData)) {
            if (
              hasActiveCompensationITF({ formData }) &&
              hasActivePensionITF({ formData })
        Severity: Minor
        Found in src/applications/simple-forms/21-0966/config/helpers.js - About 1 hr 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

        Avoid too many return statements within this function.
        Open

          return 'It may take us a few days to process your intent to file. Then you’ll have 1 year to file your claim.';
        Severity: Major
        Found in src/applications/simple-forms/21-0966/config/helpers.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return 'It may take us a few days to process your intent to file for pension claims for survivors. Then you’ll have 1 year to file your claim.';
          Severity: Major
          Found in src/applications/simple-forms/21-0966/config/helpers.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return 'It may take us a few days to process your intent to file for pension claims. Then you’ll have 1 year to file your claim.';
            Severity: Major
            Found in src/applications/simple-forms/21-0966/config/helpers.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return null;
              Severity: Major
              Found in src/applications/simple-forms/21-0966/config/helpers.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return 'It may take us a few days to process your intent to file for disability compensation. Then you’ll have 1 year to file your claim.';
                Severity: Major
                Found in src/applications/simple-forms/21-0966/config/helpers.js - About 30 mins to fix

                  Function goPathAfterGettingITF has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const goPathAfterGettingITF = (
                    { compensationIntent, pensionIntent },
                    formData,
                    goPath,
                    goNextPath,
                  Severity: Minor
                  Found in src/applications/simple-forms/21-0966/config/helpers.js - About 25 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 3 locations. Consider refactoring.
                  Open

                  export const survivingDependentContactInformationChapterTitle = ({
                    formData,
                  } = {}) => {
                    switch (formData?.preparerIdentification) {
                      case preparerIdentifications.veteran:
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 2 other locations - About 2 hrs to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 124..136
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 138..152

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

                  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

                  export const survivingDependentPersonalInformationChapterTitle = ({
                    formData,
                  } = {}) => {
                    switch (formData?.preparerIdentification) {
                      case preparerIdentifications.veteran:
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 2 other locations - About 2 hrs to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 124..136
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 154..168

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

                  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

                  export const benefitSelectionChapterTitle = ({ formData } = {}) => {
                    switch (formData?.preparerIdentification) {
                      case preparerIdentifications.veteran:
                      case preparerIdentifications.survivingDependent:
                        return 'Your benefit selection';
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 2 other locations - About 2 hrs to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 138..152
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 154..168

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

                  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

                  export const veteranContactInformationChapterTitle = ({ formData } = {}) => {
                    if (formData?.preparerIdentification === preparerIdentifications.veteran) {
                      return 'Your contact information';
                    }
                  
                  
                  Severity: Minor
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 1 other location - About 50 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 170..176

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 52.

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

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

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

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

                  Refactorings

                  Further Reading

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

                  export const veteranPersonalInformationChapterTitle = ({ formData } = {}) => {
                    if (formData?.preparerIdentification === preparerIdentifications.veteran) {
                      return 'Your personal information';
                    }
                  
                  
                  Severity: Minor
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 1 other location - About 50 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 178..184

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 52.

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

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

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

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

                  Refactorings

                  Further Reading

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

                      !isEmpty(formData?.['view:veteranPrefillStore']?.fullName) &&
                      !isEmpty(formData?.['view:veteranPrefillStore']?.ssn) &&
                      !isEmpty(formData?.['view:veteranPrefillStore']?.dateOfBirth)
                  Severity: Minor
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 1 other location - About 50 mins to fix
                  src/applications/representative-appoint/utilities/helpers.js on lines 57..59

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

                  export const shouldSeeVeteranBenefitSelectionCompensation = ({ formData }) => {
                    return preparerIsVeteran({ formData }) && hasActivePensionITF({ formData });
                  };
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 4 other locations - About 40 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 47..54
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 71..73
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 79..83
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 93..95

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

                  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

                  export const shouldSeeVeteranBenefitSelection = ({ formData }) => {
                    return preparerIsVeteran({ formData }) && noActiveITF({ formData });
                  };
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 4 other locations - About 40 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 47..54
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 75..77
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 79..83
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 93..95

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

                  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

                  export const preparerIsSurvivingDependentOrThirdPartyToSurvivingDependent = ({
                    formData,
                  }) => {
                    return (
                      preparerIsSurvivingDependent({ formData }) ||
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 4 other locations - About 40 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 71..73
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 75..77
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 79..83
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 93..95

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

                  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

                  export const preparerIsVeteranAndHasPrefill = ({ formData }) => {
                    return preparerIsVeteran({ formData }) && hasVeteranPrefill({ formData });
                  };
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 4 other locations - About 40 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 47..54
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 71..73
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 75..77
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 79..83

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

                  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

                  export const shouldSeeVeteranBenefitSelectionPension = ({ formData }) => {
                    return (
                      preparerIsVeteran({ formData }) && hasActiveCompensationITF({ formData })
                    );
                  };
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 4 other locations - About 40 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 47..54
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 71..73
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 75..77
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 93..95

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

                  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

                      if (hasActivePensionITF({ formData })) {
                        return `Our records show that you already have an intent to file for pension claims and it will expire on ${format(
                          new Date(formData['view:activePensionITF'].expirationDate),
                          'MMMM d, yyyy',
                        )}.`;
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 3 other locations - About 35 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 293..298
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 340..345
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 346..351

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

                  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

                      if (hasActiveCompensationITF({ formData })) {
                        return `Our records show that you already have an intent to file for disability compensation and it will expire on ${format(
                          new Date(formData['view:activeCompensationITF'].expirationDate),
                          'MMMM d, yyyy',
                        )}.`;
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 3 other locations - About 35 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 299..304
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 340..345
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 346..351

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

                  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

                      if (hasActiveCompensationITF({ formData })) {
                        return `Your intent to file for disability compensation expires on ${format(
                          new Date(formData['view:activeCompensationITF'].expirationDate),
                          'MMMM d, yyyy',
                        )}. If you complete and file your claim before that date and we approve your claim, you may be able to get retroactive payments. Retroactive payments are payments for the time between when we processed your intent to file and when we approved your claim.`;
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 3 other locations - About 35 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 293..298
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 299..304
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 346..351

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

                  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

                      if (hasActivePensionITF({ formData })) {
                        return `Your intent to file for pension claims expires on ${format(
                          new Date(formData['view:activePensionITF'].expirationDate),
                          'MMMM d, yyyy',
                        )}. If you complete and file your claim before that date and we approve your claim, you may be able to get retroactive payments. Retroactive payments are payments for the time between when we processed your intent to file and when we approved your claim.`;
                  Severity: Major
                  Found in src/applications/simple-forms/21-0966/config/helpers.js and 3 other locations - About 35 mins to fix
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 293..298
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 299..304
                  src/applications/simple-forms/21-0966/config/helpers.js on lines 340..345

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

                  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