department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,800 of 12,800 total issues

Function addressUISchema has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const addressUISchema = (
  addressPath,
  title,
  reviewCard,
  fieldsAreRequired = true,
Severity: Major
Found in src/applications/disability-benefits/all-claims/utils/schemas.js - About 5 hrs to fix

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

          <div className="feature">
            <h3>Application for VA education benefits (Form 22-1990)</h3>
            {claimantName.trim() ? <p>For {claimantName}</p> : <></>}
            <dl>
              <dt>Date received</dt>
    src/applications/my-education-benefits/components/confirmation/ConfirmationDenied.jsx on lines 65..78
    src/applications/my-education-benefits/components/confirmation/ConfirmationPending.jsx on lines 47..60

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 135.

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

          <div className="feature">
            <h3>Application for VA education benefits (Form 22-1990)</h3>
            {claimantName.trim() ? <p>For {claimantName}</p> : <></>}
            <dl>
              <dt>Date received</dt>
    src/applications/my-education-benefits/components/confirmation/ConfirmationApproved.jsx on lines 64..77
    src/applications/my-education-benefits/components/confirmation/ConfirmationPending.jsx on lines 47..60

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 135.

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

          <div className="feature">
            <h3>Application for VA education benefits (Form 22-1990)</h3>
            {claimantName.trim() ? <p>For {claimantName}</p> : <></>}
            <dl>
              <dt>Date received</dt>
    src/applications/my-education-benefits/components/confirmation/ConfirmationApproved.jsx on lines 64..77
    src/applications/my-education-benefits/components/confirmation/ConfirmationDenied.jsx on lines 65..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 135.

    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 GrossIncomeDescription = (
      <va-additional-info
        trigger="What we consider gross annual income"
        class="vads-u-margin-top--1 vads-u-margin-bottom--4 hydrated"
        uswds
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/IncomeDescriptions.jsx on lines 3..21

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

    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

      orderAndFilterProperties(schema, uiSchema) {
        const properties = Object.keys(schema.properties);
        const orderedProperties = orderProperties(
          properties,
          get('ui:order', uiSchema),
    Severity: Major
    Found in src/platform/forms-system/src/js/fields/ObjectField.jsx and 1 other location - About 5 hrs to fix
    src/platform/user/profile/vap-svc/components/DeselectableObjectField.jsx on lines 182..200

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

    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

      orderAndFilterProperties(schema, uiSchema) {
        const properties = Object.keys(schema.properties);
        const orderedProperties = orderProperties(
          properties,
          get('ui:order', uiSchema),
    src/platform/forms-system/src/js/fields/ObjectField.jsx on lines 127..145

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

    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 GrossIncomeDescription = (
      <va-additional-info
        trigger="What we consider gross annual income"
        class="vads-u-margin-top--1 vads-u-margin-bottom--4 hydrated"
        uswds
    src/applications/ezr/components/FormDescriptions/IncomeDescriptions.jsx on lines 3..21

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

    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 recordReportButtonClick = () => {
        recordEvent({
          // prettier-ignore
          'event': 'far-search-results-outdated',
          'search-query': query?.locationQueryString,
    src/applications/representative-search/components/results/SearchResult.jsx on lines 67..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 135.

    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 recordContactLinkClick = () => {
        recordEvent({
          // prettier-ignore
          'event': 'far-search-results-click',
          'search-query': query?.locationQueryString,
    src/applications/representative-search/components/results/SearchResult.jsx on lines 87..105

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

    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

                <div className="vads-l-col--12 small-screen:vads-l-col--6 vads-u-margin--1">
                  <VaCheckboxGroup
                    uswds
                    label="V3 Checkbox Group"
                    onVaChange={e => updateCheckboxValue(e, 'v3')}
    Severity: Major
    Found in src/applications/ds-playground/pages/V1V3Page.jsx and 1 other location - About 5 hrs to fix
    src/applications/ds-v3-playground/pages/V3BasePage.jsx on lines 207..218

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

    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

              <div className="vads-grid-col">
                <VaCheckboxGroup
                  uswds
                  label="V3 Checkbox Group"
                  onVaChange={e => updateCheckboxValue(e, 'v3')}
    Severity: Major
    Found in src/applications/ds-v3-playground/pages/V3BasePage.jsx and 1 other location - About 5 hrs to fix
    src/applications/ds-playground/pages/V1V3Page.jsx on lines 286..297

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

    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 default function SSNWidget({ value }) {
      if (value && value.length === 9) {
        return (
          <span
            className="dd-privacy-hidden"
    Severity: Major
    Found in src/platform/forms-system/src/js/review/SSNWidget.jsx and 1 other location - About 5 hrs to fix
    src/platform/forms-system/src/js/review/VAFileNumberWidget.jsx on lines 3..17

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

    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 default function VAFileNumberWidget({ value }) {
      if (value && value.length === 9) {
        return (
          <span className="dd-privacy-hidden" data-dd-action-name="VA file number">
            {`${value.substr(0, 3)}-${value.substr(3, 2)}-${value.substr(5)}`}
    src/platform/forms-system/src/js/review/SSNWidget.jsx on lines 3..23

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

    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

    File ctaWidgets.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Relative imports.
    import backendServices from '~/platform/user/profile/constants/backendServices';
    import featureFlagNames from '~/platform/utilities/feature-toggles/featureFlagNames';
    import { mhvUrl } from '~/platform/site-wide/mhv/utilities';
    import { getAppUrl } from '~/platform/utilities/registry-helpers';
    Severity: Minor
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js - About 5 hrs to fix

      File MOCK_VA_APPOINTMENTS.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const fns = require('date-fns');
      
      const MOCK_VA_APPOINTMENTS = {
        data: [
          {

        Function uploadFile has 124 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function uploadFile(
          file,
          uiOptions,
          onProgress,
          onChange,
        Severity: Major
        Found in src/platform/forms-system/src/js/actions.js - About 4 hrs to fix

          Function render has 124 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { item, scopes } = this.props;
              const { setShow } = this;
              const { learnIcon, show } = this.state;
          
          

            Function Confirmation has 124 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Confirmation = props => {
              const dispatch = useDispatch();
              const refreshAppointments = useCallback(
                () => {
                  dispatch(triggerRefresh());
            Severity: Major
            Found in src/applications/check-in/day-of/pages/Confirmation/index.jsx - About 4 hrs to fix

              Function UpcomingAppointmentsListItem has 124 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const UpcomingAppointmentsListItem = props => {
                const { app, appointment, goToDetails, router, border, count } = props;
                const { t } = useTranslation();
                const { getCurrentPageFromRouter } = useFormRouting(router);
                const page = getCurrentPageFromRouter();
              Severity: Major
              Found in src/applications/check-in/components/UpcomingAppointmentsListItem.jsx - About 4 hrs to fix
                Severity
                Category
                Status
                Source
                Language