department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

Function SearchControls has 252 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SearchControls = props => {
  const {
    currentQuery,
    onChange,
    geolocateUser,

    Function DashboardCards has 252 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const DashboardCards = () => {
      const [error, hasError] = useState(false);
      const [inquiries, setInquiries] = useState([]);
      const [lastUpdatedFilter, setLastUpdatedFilter] = useState('newestToOldest');
      const [statusFilter, setStatusFilter] = useState('All');
    Severity: Major
    Found in src/applications/ask-va/containers/DashboardCardsMock.jsx - About 1 day to fix

      File form.js has 586 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import fullSchemaHca from 'vets-json-schema/dist/10-10EZ-schema.json';
      
      // platform imports
      import environment from '@department-of-veterans-affairs/platform-utilities/environment';
      import FormFooter from '@department-of-veterans-affairs/platform-forms/FormFooter';
      Severity: Major
      Found in src/applications/hca/config/form.js - About 1 day to fix

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

            insuranceInformation: {
              title: 'Insurance information',
              pages: {
                medicaidEligibility: {
                  path: 'insurance-information/medicaid-eligibility',
        src/applications/ezr/config/form.js on lines 387..430

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

        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 default function RaceEthnicityReviewField(props) {
          const { formContext, uiSchema, schema, formData } = props;
          const { ObjectField } = props.registry.fields;
        
          if (!formContext.reviewMode) {
        src/applications/pre-need-integration/components/RaceEthnicityReviewField.jsx on lines 3..27

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

        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

            insuranceInformation: {
              title: 'Insurance information',
              pages: {
                medicaidEligibility: {
                  path: 'insurance-information/medicaid-eligibility',
        Severity: Major
        Found in src/applications/ezr/config/form.js and 1 other location - About 1 day to fix
        src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/config/form.js on lines 248..291

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

        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

              <div className="vads-u-margin-top--5 vads-u-margin-bottom--5">
                <va-accordion
                  disable-analytics={{
                    value: 'false',
                  }}
        Severity: Major
        Found in src/applications/ask-va/containers/IntroductionPage.jsx and 1 other location - About 1 day to fix
        src/applications/ask-va/containers/IntroductionPage.jsx on lines 260..303

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

        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

              <div className="vads-u-margin-top--5 vads-u-margin-bottom--5">
                <va-accordion
                  disable-analytics={{
                    value: 'false',
                  }}
        Severity: Major
        Found in src/applications/ask-va/containers/IntroductionPage.jsx and 1 other location - About 1 day to fix
        src/applications/ask-va/containers/IntroductionPage.jsx on lines 316..359

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

        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 default function RaceEthnicityReviewField(props) {
          const { formContext, uiSchema, schema, formData } = props;
          const { ObjectField } = props.registry.fields;
        
          if (!formContext.reviewMode) {
        src/applications/pre-need/components/RaceEthnicityReviewField.jsx on lines 3..27

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

        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

              <ConfirmationDecisionReviews
                pageTitle="Request a Board Appeal"
                alertTitle="We’ve received your Board Appeal request"
              >
                <h2 className="vads-u-font-size--h3">
        src/applications/appeals/testing/hlr/containers/ConfirmationPage.jsx on lines 12..53

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

        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

            <ConfirmationDecisionReviews
              pageTitle="Request a Higher-Level Review"
              alertTitle="We’ve received your Higher-Level Review"
            >
              <h2 className="vads-u-font-size--h3">
        src/applications/appeals/10182/containers/ConfirmationPage.jsx on lines 17..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 236.

        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 ConfirmationPage has 251 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const ConfirmationPage = props => {
          const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
          const showUpdatedConfirmation = useToggleValue(
            TOGGLE_NAMES.pensionConfirmationUpdate,
          );
        Severity: Major
        Found in src/applications/pensions/containers/ConfirmationPage.jsx - About 1 day to fix

          Function transform has 250 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const transform = (formConfig, form) => {
            const {
              questions,
              personalIdentification,
              personalData: {
          Severity: Major
          Found in src/applications/financial-status-report/utils/transform.js - About 1 day to fix

            File disabilityLabelsRevised.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // note: the id's are no longer used for classification, but are kept here for compatibility with the old code
            
            export default {
              0: 'ACL tear (anterior cruciate ligament tear), bilateral',
              1: 'ACL tear (anterior cruciate ligament tear), left',

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

              const poll = ({
                endpoint,
                validate = response => response && response.data,
                interval = FIVE_SECONDS,
                endTime = ONE_MINUTE_IN_THE_FUTURE(),
              Severity: Major
              Found in src/applications/toe/actions.js and 1 other location - About 1 day to fix
              src/applications/my-education-benefits/actions/index.js on lines 103..137

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

              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 poll = ({
                endpoint,
                validate = response => response && response.data,
                interval = FIVE_SECONDS,
                endTime = ONE_MINUTE_IN_THE_FUTURE(),
              Severity: Major
              Found in src/applications/my-education-benefits/actions/index.js and 1 other location - About 1 day to fix
              src/applications/toe/actions.js on lines 117..154

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

              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 a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
              Open

              const FileField = props => {
                const {
                  enableShortWorkflow,
                  errorSchema,
                  formContext,
              Severity: Minor
              Found in src/platform/forms-system/src/js/fields/FileField.jsx - About 1 day 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 FileField has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
              Open

              const FileField = props => {
                const {
                  errorSchema,
                  formContext,
                  formData = [],
              Severity: Minor
              Found in src/applications/appeals/shared/components/FileField.jsx - About 1 day to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                  {
                    id: '6',
                    type: 'inquiry',
                    attributes: {
                      inquiryNumber: 'A-20240824-306412',
              Severity: Major
              Found in src/applications/ask-va/utils/mockData.js and 2 other locations - About 1 day to fix
              src/applications/ask-va/utils/mockData.js on lines 1604..1665
              src/applications/ask-va/utils/mockData.js on lines 1855..1915

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

              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

                  {
                    id: '2',
                    type: 'inquiry',
                    attributes: {
                      inquiryNumber: 'A-20240824-306412',
              Severity: Major
              Found in src/applications/ask-va/utils/mockData.js and 2 other locations - About 1 day to fix
              src/applications/ask-va/utils/mockData.js on lines 1855..1915
              src/applications/ask-va/utils/mockData.js on lines 2051..2111

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

              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

              Severity
              Category
              Status
              Source
              Language