department-of-veterans-affairs/vets-website

View on GitHub
src/applications/verify-your-enrollment/helpers.jsx

Summary

Maintainability
F
2 wks
Test Coverage

File helpers.jsx has 768 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-nested-ternary */
/* eslint-disable react/jsx-key */ // keys are defined, error being thrown in eslint even when key is defined
import React from 'react';
import ADDRESS_DATA from 'platform/forms/address/data';
import { v4 as uuidv4 } from 'uuid';
Severity: Major
Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 day to fix

    Function getGroupedPreviousEnrollments has 163 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getGroupedPreviousEnrollments = month => {
      const { transactDate, actBegin, actEnd, id, paymentDate } = month[0];
      const myUUID = uuidv4();
    
      return (
    Severity: Major
    Found in src/applications/verify-your-enrollment/helpers.jsx - About 6 hrs to fix

      Function getSignlePreviousEnrollments has 127 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getSignlePreviousEnrollments = awards => {
        const myUUID = uuidv4();
        return (
          <div className="vye-top-border" key={myUUID}>
            {awards.transactDate &&
      Severity: Major
      Found in src/applications/verify-your-enrollment/helpers.jsx - About 5 hrs to fix

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

        export const combineEnrollmentsWithStartMonth = enrollmentPeriods => {
          const isArray = Array.isArray(enrollmentPeriods);
        
          const trackDate = [];
          const combineMonths = {};
        Severity: Minor
        Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

          Function getGroupedPreviousEnrollments has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          export const getGroupedPreviousEnrollments = month => {
            const { transactDate, actBegin, actEnd, id, paymentDate } = month[0];
            const myUUID = uuidv4();
          
            return (
          Severity: Minor
          Found in src/applications/verify-your-enrollment/helpers.jsx - 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 compareAddressObjects has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          export function compareAddressObjects(obj1, obj2) {
            const { hasOwnProperty } = Object.prototype;
          
            const keys1 = Object.keys(obj1);
            const keys2 = Object.keys(obj2);
          Severity: Minor
          Found in src/applications/verify-your-enrollment/helpers.jsx - 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 addressLabel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const addressLabel = address => {
            // Destructure address object for easier access
            const {
              addressLine1,
              addressLine2,
          Severity: Minor
          Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

            Function getPeriodsToVerify has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const getPeriodsToVerify = pendingEnrollments => {
              return pendingEnrollments
                .map(enrollmentToBeVerified => {
                  const {
                    actBegin,
            Severity: Minor
            Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

              Function getDateRangesBetween has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const getDateRangesBetween = (date1, date2) => {
                const [year1, month1] = date1.split('-').map(str => parseInt(str, 10));
                const [year2, month2] = date2.split('-').map(str => parseInt(str, 10));
              
                const ranges = [];
              Severity: Minor
              Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                Function compareAddressObjects has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function compareAddressObjects(obj1, obj2) {
                  const { hasOwnProperty } = Object.prototype;
                
                  const keys1 = Object.keys(obj1);
                  const keys2 = Object.keys(obj2);
                Severity: Minor
                Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                  Function prepareAddressData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const prepareAddressData = formData => {
                    let addressData = {
                      veteranName: formData.fullName,
                      addressLine1: formData.addressLine1,
                      addressLine2: formData.addressLine2,
                  Severity: Minor
                  Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                    Function deepEqual has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function deepEqual(obj1, obj2) {
                      if (obj1 === obj2) return true;
                    
                      if (
                        typeof obj1 !== 'object' ||
                    Severity: Minor
                    Found in src/applications/verify-your-enrollment/helpers.jsx - 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 deepEqual has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function deepEqual(obj1, obj2) {
                      if (obj1 === obj2) return true;
                    
                      if (
                        typeof obj1 !== 'object' ||
                    Severity: Minor
                    Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                      Function getSignlePreviousEnrollments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const getSignlePreviousEnrollments = awards => {
                        const myUUID = uuidv4();
                        return (
                          <div className="vye-top-border" key={myUUID}>
                            {awards.transactDate &&
                      Severity: Minor
                      Found in src/applications/verify-your-enrollment/helpers.jsx - About 35 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

                      Avoid too many return statements within this function.
                      Open

                        return true;
                      Severity: Major
                      Found in src/applications/verify-your-enrollment/helpers.jsx - About 30 mins to fix

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

                        export const addressLabel = address => {
                          // Destructure address object for easier access
                          const {
                            addressLine1,
                            addressLine2,
                        Severity: Minor
                        Found in src/applications/verify-your-enrollment/helpers.jsx - 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

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

                        export const hasFormChanged = obj => {
                          const keys = Object.keys(obj ?? {});
                          for (const key of keys) {
                            const value = obj[key];
                            // Skip the specific key
                        Severity: Minor
                        Found in src/applications/verify-your-enrollment/helpers.jsx - 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

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

                        export const getDateRangesBetween = (date1, date2) => {
                          const [year1, month1] = date1.split('-').map(str => parseInt(str, 10));
                          const [year2, month2] = date2.split('-').map(str => parseInt(str, 10));
                        
                          const ranges = [];
                        Severity: Minor
                        Found in src/applications/verify-your-enrollment/helpers.jsx - 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

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

                        export const translateDateIntoMonthDayYearFormat = dateString => {
                          // Parse the date string as UTC
                          if (!dateString) return null;
                          const [year, month, day] = dateString
                            .split('-')
                        Severity: Minor
                        Found in src/applications/verify-your-enrollment/helpers.jsx - 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 2 locations. Consider refactoring.
                        Open

                                  <va-additional-info
                                    trigger={`
                                      ${
                                        actBegin !== null
                                          ? translateDateIntoMonthYearFormat(actBegin)
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 day to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 357..403

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

                        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

                                  <va-additional-info
                                    trigger={`${translateDateIntoMonthYearFormat(
                                      actBegin,
                                    )} verification details`}
                                    class="vads-u-margin-bottom--4"
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 day to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 290..340

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

                        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

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

                        export function compareAddressObjects(obj1, obj2) {
                          const { hasOwnProperty } = Object.prototype;
                        
                          const keys1 = Object.keys(obj1);
                          const keys2 = Object.keys(obj2);
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 day to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 134..172

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

                        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

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

                        export const prepareAddressData = formData => {
                          let addressData = {
                            veteranName: formData.fullName,
                            addressLine1: formData.addressLine1,
                            addressLine2: formData.addressLine2,
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 day to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 48..78

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

                        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

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

                                    <va-additional-info
                                      trigger={`${translateDateIntoMonthYearFormat(
                                        awards.actBegin,
                                      )} verification details`}
                                      class="vads-u-margin-bottom--4"
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 7 hrs to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 456..487

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

                        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

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

                                    <va-additional-info
                                      trigger={`
                                    ${
                                      awards.actBegin !== null
                                        ? translateDateIntoMonthYearFormat(awards.actBegin)
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 7 hrs to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 506..533

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

                        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

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

                        function deepEqual(obj1, obj2) {
                          if (obj1 === obj2) return true;
                        
                          if (
                            typeof obj1 !== 'object' ||
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 7 hrs to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 175..208

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

                        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

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

                                    <h3 className="vads-u-font-size--h4 vads-u-display--flex vads-u-align-items--center">
                                      <span className="vads-u-display--inline-block ">
                                        {awards.actBegin !== null
                                          ? translateDateIntoMonthYearFormat(awards.actBegin)
                                          : translateDateIntoMonthYearFormat(awards.actEnd)}
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 4 hrs to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 493..505

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

                        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

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

                                    <h3 className="vads-u-font-size--h4 vads-u-display--flex vads-u-align-items--center">
                                      <span className="vads-u-display--inline-block ">
                                        {awards.actBegin !== null
                                          ? translateDateIntoMonthYearFormat(awards.actBegin)
                                          : translateDateIntoMonthYearFormat(awards.actEnd)}
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 4 hrs to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 442..454

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

                        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

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

                                  <h3 className="vads-u-font-size--h4 vads-u-display--flex vads-u-align-items--center">
                                    <span className="vads-u-display--inline-block ">
                                      {actBegin !== null
                                        ? translateDateIntoMonthYearFormat(actBegin)
                                        : translateDateIntoMonthYearFormat(actEnd)}
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 3 hrs to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 344..356

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

                        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

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

                                  <h3 className="vads-u-font-size--h4 vads-u-display--flex vads-u-align-items--center">
                                    <span className="vads-u-display--inline-block ">
                                      {actBegin !== null
                                        ? translateDateIntoMonthYearFormat(actBegin)
                                        : translateDateIntoMonthYearFormat(actEnd)}
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 3 hrs to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 276..288

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

                        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

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

                        export const formatAddress = address => {
                          const city = address?.city ?? '';
                          const stateCode = address?.stateCode ?? '';
                          const zipCode = address?.zipCode ?? '';
                        
                        
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 3 hrs to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 39..47

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

                        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

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

                        export const hasFormChanged = obj => {
                          const keys = Object.keys(obj ?? {});
                          for (const key of keys) {
                            const value = obj[key];
                            // Skip the specific key
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 3 hrs to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 117..132

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

                        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

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

                        export const MILITARY_STATES = Object.entries(ADDRESS_DATA.states).reduce(
                          (militaryStates, [stateCode, stateName]) => {
                            if (ADDRESS_DATA.militaryStates.includes(stateCode)) {
                              return {
                                ...militaryStates,
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 2 hrs to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 15..26

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 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

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

                        const initialState = {
                          addressLine1: undefined,
                          addressLine2: undefined,
                          addressLine3: undefined,
                          addressLine4: undefined,
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 hr to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 210..223

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

                        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

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

                                    <va-alert
                                      background-only
                                      class="vads-u-margin-bottom--3"
                                      close-btn-aria-label="Close notification"
                                      disable-analytics="true"
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 hr to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 411..427

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

                        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

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

                                    <va-alert
                                      background-only
                                      class="vads-u-margin-bottom--3"
                                      close-btn-aria-label="Close notification"
                                      disable-analytics="true"
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 hr to fix
                        src/applications/verify-your-enrollment/helpers.jsx on lines 542..558

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

                        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

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

                        export function hasAddressFormChanged(currentState) {
                          const filledCurrentState = {
                            ...initialState,
                            ...currentState,
                            stateCode:
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 hr to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 226..236

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

                        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

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

                        export const scrollToElement = el => {
                          const element = document.getElementById(el);
                          if (element) {
                            element.scrollIntoView({ behavior: 'smooth' });
                          }
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 1 hr to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 7..12

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

                        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

                          const {
                            addressLine1,
                            addressLine2,
                            addressLine3,
                            addressLine4,
                        Severity: Major
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 2 other locations - About 1 hr to fix
                        src/applications/edu-benefits/feedback-tool/reducers/schoolSelect.js on lines 165..175
                        src/applications/personalization/profile/components/direct-deposit/AccountUpdateView.jsx on lines 75..85

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

                        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 noSuggestedAddress = deliveryPointValidation => {
                          return (
                            deliveryPointValidation === BAD_UNIT_NUMBER ||
                            deliveryPointValidation === MISSING_UNIT_NUMBER ||
                            deliveryPointValidation === 'MISSING_ZIP' ||
                        Severity: Minor
                        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 35 mins to fix
                        src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 31..38

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

                        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