department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

Function SearchResultsHeader has 158 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const SearchResultsHeader = props => {
  const { searchResults, pagination, query } = props;
  const {
    inProgress,
    context,

    Function NearbyLocations has 158 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const NearbyLocations = props => {
      const [originalCoordinates, setOriginalCoordinates] = useState([]);
      const [nearbyVADistances, setNearbyVADistances] = useState(false);
      const dispatch = useDispatch();
    
    

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

        render() {
          const { supplies, order, eligibility } = this.props;
          const currentDate = moment();
          const accessorySupplies = supplies.filter(
            supply => supply.productGroup === ACCESSORY,
      Severity: Major
      Found in src/applications/disability-benefits/2346/components/Accessories.jsx - About 6 hrs to fix

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

              <va-alert status="warning" uswds class="vads-u-margin-bottom--4">
                <h2 slot="headline">
                  We can’t match your information to any military service records
                </h2>
                <div>
        src/applications/personalization/profile/components/military-information/MilitaryInformation.jsx on lines 49..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 161.

        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 distancesToNearbyVetCenters = (
          originalVetCenterCoordinates,
          nearbyVetCentersCoordinates,
        ) => {
          const originalVetCenterCoordinatesParam = originalVetCenterCoordinates.join(
        Severity: Major
        Found in src/applications/facility-locator/utils/facilityDistance.js and 1 other location - About 6 hrs to fix
        src/applications/representative-search/utils/representativeDistance.js on lines 68..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 161.

        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 distancesToNearbyVetCenters = (
          originalVetCenterCoordinates,
          nearbyVetCentersCoordinates,
        ) => {
          const originalVetCenterCoordinatesParam = originalVetCenterCoordinates.join(
        src/applications/facility-locator/utils/facilityDistance.js on lines 73..90

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

        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
                status="warning"
                data-testid="not-in-deers-alert"
                uswds
                class="vads-u-margin-bottom--4"
        src/applications/personalization/profile/components/military-information/MilitaryInformation.jsx on lines 93..124

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

        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

        function disabilityRating(state = DISABILITY_RATING_INIT_STATE, action) {
          const { response = {}, error = null, type } = action;
          const {
            FETCH_DISABILITY_RATING_STARTED,
            FETCH_DISABILITY_RATING_FAILED,
        Severity: Major
        Found in src/applications/hca/reducers/disability-rating.js and 1 other location - About 6 hrs to fix
        src/applications/ezr/reducers/disability-rating.js on lines 13..41

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

        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

        function disabilityRating(state = DISABILITY_RATING_INIT_STATE, action) {
          const { response = {}, error = null, type } = action;
          const {
            FETCH_DISABILITY_RATING_STARTED,
            FETCH_DISABILITY_RATING_FAILED,
        Severity: Major
        Found in src/applications/ezr/reducers/disability-rating.js and 1 other location - About 6 hrs to fix
        src/applications/hca/reducers/disability-rating.js on lines 6..30

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

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

        const CheckInConfirmation = props => {
          const { selectedAppointment, triggerRefresh, router } = props;
          const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
          const featureToggles = useSelector(selectFeatureToggles);
          const {

          Function getNewAppointmentFlow has 157 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function getNewAppointmentFlow(state) {
            const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(state);
            const flowType = getFlowType(state);
            const isSingleVaFacility = selectSingleSupportedVALocation(state);
          
          
          Severity: Major
          Found in src/applications/vaos/new-appointment/newAppointmentFlow.js - About 6 hrs to fix

            File FormPage.jsx has 428 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import PropTypes from 'prop-types';
            import React from 'react';
            import { connect } from 'react-redux';
            import { withRouter } from 'react-router';
            import classNames from 'classnames';
            Severity: Minor
            Found in src/platform/forms-system/src/js/containers/FormPage.jsx - About 6 hrs to fix

              Function SearchControls has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
              Open

              const SearchControls = props => {
                const {
                  currentQuery,
                  onChange,
                  onSubmit,
              Severity: Minor
              Found in src/applications/facility-locator/components/SearchControls.jsx - About 6 hrs 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 VerifyEnrollmentsPage has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
              Open

              export const VerifyEnrollmentsPage = ({
                editMonthVerification,
                enrollmentVerification,
                enrollmentVerificationFetchFailure,
                enrollmentVerificationSubmitted,

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

              const useGetCheckInData = ({
                refreshNeeded,
                appointmentsOnly = false,
                reload = false,
                router,
              Severity: Minor
              Found in src/applications/check-in/hooks/useGetCheckInData.jsx - About 6 hrs 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

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

              function addressReducer(state = initialState, action) {
                switch (action.type) {
                  case ADDRESS_VALIDATION_START:
                    return {
                      ...state,
              src/applications/personalization/profile/components/direct-deposit/vye/reducers/addressValidation.js on lines 15..54

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

              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 addressReducer(state = initialState, action) {
                switch (action.type) {
                  case ADDRESS_VALIDATION_START:
                    return {
                      ...state,
              src/applications/verify-your-enrollment/reducers/addressValidation.js on lines 15..54

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

              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 nameAndAddressPage = {
                uiSchema: {
                  ...arrayBuilderItemFirstPageTitleUI({
                    title: 'Where did the claimant receive medical treatment?',
                    description:
              src/applications/simple-forms/20-10207/pages/medicalTreatment.js on lines 32..67
              src/applications/simple-forms/20-10207/pages/medicalTreatmentThirdPartyVeteran.js on lines 32..68

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

              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 nameAndAddressPage = {
                uiSchema: {
                  ...arrayBuilderItemFirstPageTitleUI({
                    title: 'Where did the Veteran receive medical treatment?',
                    description:
              src/applications/simple-forms/20-10207/pages/medicalTreatment.js on lines 32..67
              src/applications/simple-forms/20-10207/pages/medicalTreatmentThirdPartyNonVeteran.js on lines 32..68

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

              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 nameAndAddressPage = {
                uiSchema: {
                  ...arrayBuilderItemFirstPageTitleUI({
                    title: 'Where did you receive medical treatment?',
                    description:
              src/applications/simple-forms/20-10207/pages/medicalTreatmentThirdPartyNonVeteran.js on lines 32..68
              src/applications/simple-forms/20-10207/pages/medicalTreatmentThirdPartyVeteran.js on lines 32..68

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

              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