department-of-veterans-affairs/vets-website

View on GitHub

Showing 14,709 of 14,709 total issues

Function renderAdditionalInfo has 564 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const renderAdditionalInfo = (diaryCode, dateOfLetter, benefitType) => {
  switch (diaryCode) {
    case '71':
      return {
        status:

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

    import merge from 'lodash/merge';
    import { format, isValid, parseISO } from 'date-fns';
    
    import environment from '@department-of-veterans-affairs/platform-utilities/environment';
    import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/api';
    Severity: Major
    Found in src/applications/claims-status/utils/helpers.js - About 2 days to fix

      File calculator.js has 1093 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { isEmpty } from 'lodash';
      import { createSelector } from 'reselect';
      import {
        formatCurrency,
        isCountryUSA,
      Severity: Major
      Found in src/applications/gi/selectors/calculator.js - About 2 days to fix

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

        const WiderThanMobileOfficialGovtWebsite = () => {
          const [isExpanded, setIsExpanded] = useState(false);
        
          const toggleExpansion = () => {
            setIsExpanded(!isExpanded);
        src/applications/accredited-representative-portal/accreditation/21a/components/common/Header/WiderThanMobileHeader/WiderThanMobileOfficialGovtWebsite.jsx on lines 3..80

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 478.

        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 WiderThanMobileOfficialGovtWebsite = () => {
          const [isExpanded, setIsExpanded] = useState(false);
        
          const toggleExpansion = () => {
            setIsExpanded(!isExpanded);
        src/applications/accredited-representative-portal/components/common/Header/WiderThanMobileHeader/WiderThanMobileOfficialGovtWebsite.jsx on lines 3..80

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 478.

        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 transform(formConfig, form) {
          // Copy over sponsor data if the claimant is the veteran.
          const populateSponsorData = application =>
            isVeteran({ application })
              ? merge({}, application, {
        Severity: Major
        Found in src/applications/pre-need/utils/helpers.js and 1 other location - About 2 days to fix
        src/applications/pre-need-integration/utils/helpers.js on lines 635..747

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

        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 transform(formConfig, form) {
          // Copy over sponsor data if the claimant is the veteran.
          const populateSponsorData = application =>
            isVeteran({ application })
              ? merge({}, application, {
        Severity: Major
        Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 2 days to fix
        src/applications/pre-need/utils/helpers.js on lines 433..545

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

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

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

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

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

        Refactorings

        Further Reading

        Function FileField has 549 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const FileField = props => {
          const {
            enableShortWorkflow,
            errorSchema,
            formContext,
        Severity: Major
        Found in src/platform/forms-system/src/js/fields/FileField.jsx - About 2 days to fix

          Function FacilitiesMap has 545 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const FacilitiesMap = props => {
            const [map, setMap] = useState(null);
            const searchResultTitleRef = useRef(null);
            const searchResultMessageRef = useRef();
            const [isMobile, setIsMobile] = useState(window.innerWidth <= 481);
          Severity: Major
          Found in src/applications/facility-locator/containers/FacilitiesMap.jsx - About 2 days to fix

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

            const formConfig = {
              rootUrl: manifest.rootUrl,
              urlPrefix: '/',
              // submitUrl: '/v0/api',
              submit: () =>
            Severity: Major
            Found in src/applications/edu-benefits/1919/config/form.js and 1 other location - About 2 days to fix
            src/applications/edu-benefits/8794/config/form.js on lines 32..138

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 471.

            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

            const formConfig = {
              rootUrl: manifest.rootUrl,
              urlPrefix: '/',
              // submitUrl: '/v0/api',
              submit: () =>
            Severity: Major
            Found in src/applications/edu-benefits/8794/config/form.js and 1 other location - About 2 days to fix
            src/applications/edu-benefits/1919/config/form.js on lines 32..138

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 471.

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

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

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

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

            Refactorings

            Further Reading

            Function FileField has 543 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const FileField = props => {
              const {
                enableShortWorkflow,
                errorSchema,
                formContext,
            Severity: Major
            Found in src/applications/simple-forms/40-0247/components/FileField.jsx - About 2 days to fix

              File moment-tz.js has 1071 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* istanbul ignore file */
              //! moment-timezone.js
              //! version : 0.5.25
              //! Copyright (c) JS Foundation and other contributors
              //! license : MIT
              Severity: Major
              Found in src/applications/vaos/lib/moment-tz.js - About 2 days to fix

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

                  const updateFormData = () => {
                    if (
                      !isValidStartDate(employmentRecord.from) ||
                      (!isValidEndDate(employmentRecord.from, employmentRecord.to) &&
                        !employmentRecord.isCurrent)
                src/applications/financial-status-report/components/employment/EmploymentWorkDates.jsx on lines 53..125

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

                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

                  const updateFormData = () => {
                    if (
                      !isValidStartDate(employmentRecord.from) ||
                      (!isValidEndDate(employmentRecord.from, employmentRecord.to) &&
                        !employmentRecord.isCurrent)
                src/applications/financial-status-report/components/employment/SpouseEmploymentWorkDates.jsx on lines 53..128

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

                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

                SaveInProgressIntro.propTypes = {
                  fetchInProgressForm: PropTypes.func.isRequired,
                  formId: PropTypes.string.isRequired,
                  pageList: PropTypes.array.isRequired,
                  removeInProgressForm: PropTypes.func.isRequired,
                src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskOrange/pages/introduction/SaveInProgressIntro.jsx on lines 448..498

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

                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

                SaveInProgressIntro.propTypes = {
                  fetchInProgressForm: PropTypes.func.isRequired,
                  formId: PropTypes.string.isRequired,
                  pageList: PropTypes.array.isRequired,
                  removeInProgressForm: PropTypes.func.isRequired,
                src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskBlue/SaveInProgressIntro.jsx on lines 451..501

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

                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

                const DependentsReviewPage = ({ data, editPage }) => {
                  const { dependents } = data;
                  const reviewRows = dependents.map((item, index) => {
                    const { fullName, dependentRelation } = item;
                    const dependentName = normalizeFullName(fullName);
                src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/DependentsReviewPage.jsx on lines 6..58

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

                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

                const DependentsReviewPage = ({ data, editPage }) => {
                  const { dependents } = data;
                  const reviewRows = dependents.map((item, index) => {
                    const { fullName, dependentRelation } = item;
                    const dependentName = normalizeFullName(fullName);
                src/applications/ezr/components/FormReview/DependentsReviewPage.jsx on lines 6..58

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

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

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

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

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

                Refactorings

                Further Reading

                Function FileField has 533 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const FileField = props => {
                  const {
                    enableShortWorkflow,
                    errorSchema,
                    formContext,
                Severity: Major
                Found in src/applications/pre-need/components/FileField.jsx - About 2 days to fix
                  Severity
                  Category
                  Status
                  Source
                  Language