department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

Function onAllComplete has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            onAllComplete: () => {
              if (canUseMocks()) {
                dispatch({ type: DONE_UPLOADING });
                dispatch(
                  setNotification({
Severity: Major
Found in src/applications/claims-status/actions/index.js - About 2 hrs to fix

    Function fetchMilitaryInformation has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function fetchMilitaryInformation(recordAnalyticsEvent = recordEvent) {
      return async dispatch => {
        dispatch({ type: FETCH_MILITARY_INFORMATION });
    
        const baseUrl = '/profile/service_history';
    Severity: Major
    Found in src/applications/personalization/profile/actions/index.js - About 2 hrs to fix

      Function careSummariesAndNotesReducer has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const careSummariesAndNotesReducer = (state = initialState, action) => {
        switch (action.type) {
          case Actions.CareSummariesAndNotes.GET: {
            return {
              ...state,

        Function RxBreadcrumbs has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const RxBreadcrumbs = () => {
          const location = useLocation();
          const prescription = useSelector(
            state => state.rx.prescriptions?.prescriptionDetails,
          );
        Severity: Major
        Found in src/applications/mhv-medications/containers/RxBreadcrumbs.jsx - About 2 hrs to fix

          Function pdfData has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              allergiesPdfList => {
                return {
                  subject: `Single Medication Record - ${prescription?.prescriptionName}`,
                  headerBanner: [
                    {
          Severity: Major
          Found in src/applications/mhv-medications/containers/PrescriptionDetails.jsx - About 2 hrs to fix

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

              const facilityPhone =
                appointment?.vaos.apiData.extension?.clinic?.phoneNumber ||
                facility?.telecom?.find(tele => tele.system === 'covid')?.value ||
                facility?.telecom?.find(tele => tele.system === 'phone')?.value;
            Severity: Major
            Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 2 hrs to fix
            src/applications/vaos/appointment-list/redux/selectors.js on lines 814..817

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

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

                            {!file.uploading && (
                              <>
                                <strong
                                  id={fileNameId}
                                  className="dd-privacy-hidden"
            Severity: Major
            Found in src/platform/forms-system/src/js/fields/FileField.jsx and 3 other locations - About 2 hrs to fix
            src/applications/appeals/shared/components/FileField.jsx on lines 524..535
            src/applications/pre-need/components/FileField.jsx on lines 550..561
            src/applications/simple-forms/40-0247/components/FileField.jsx on lines 552..563

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

            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

                    if (req.status === 429) {
                      error = new Error(`vets_throttled_error: ${req.statusText}`);
                      error.extra = parseInt(
                        req.getResponseHeader('x-ratelimit-reset'),
                        10,
            Severity: Major
            Found in src/platform/forms-system/src/js/actions.js and 1 other location - About 2 hrs to fix
            src/applications/disability-benefits/all-claims/config/submitForm.js on lines 39..47

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 91.

            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 facilityPhone =
                appointment?.vaos.apiData.extension?.clinic?.phoneNumber ||
                facility?.telecom?.find(tele => tele.system === 'covid')?.value ||
                facility?.telecom?.find(tele => tele.system === 'phone')?.value;
            Severity: Major
            Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 2 hrs to fix
            src/applications/vaos/appointment-list/redux/selectors.js on lines 747..750

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

            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

                  describe('updateFormHandler', () => {
                    it('should return the correct structure', () => {
                      const action = updateFormAction({
                        patientDemographicsStatus: {},
                      });
            src/applications/check-in/reducers/pre-check-in/pre-check-in.reducers.unit.spec.js on lines 113..122

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

            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 {
              uiSchema: {
                attendedSchoolLastYear: yesNoUI(
                  replaceStrValues(
                    content['household-dependent-attended-school-label'],
            src/applications/ezr/config/chapters/householdInformation/dependentEducationExpenses.js on lines 18..40

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

            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

                        veteranFullName: _.merge(fullNameUI, {
                          first: {
                            'ui:title': 'First name',
                          },
                          last: {
            Severity: Major
            Found in src/applications/mock-sip-form/config/form.js and 1 other location - About 2 hrs to fix
            src/applications/coronavirus-research/sign-up/pages/covidResearchUISchema.js on lines 858..878

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

            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

                      if (req.status === 429) {
                        error = new Error(`vets_throttled_error: ${req.statusText}`);
                        error.extra = parseInt(
                          req.getResponseHeader('x-ratelimit-reset'),
                          10,
            src/platform/forms-system/src/js/actions.js on lines 112..120

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

            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

              veteranFullName: _.merge(fullNameUI, {
                first: {
                  'ui:title': 'First name',
                },
                last: {
            src/applications/mock-sip-form/config/form.js on lines 49..69

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

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

                            {!file.uploading && (
                              <>
                                <strong
                                  id={fileNameId}
                                  className="dd-privacy-hidden"
            Severity: Major
            Found in src/applications/appeals/shared/components/FileField.jsx and 3 other locations - About 2 hrs to fix
            src/applications/pre-need/components/FileField.jsx on lines 550..561
            src/applications/simple-forms/40-0247/components/FileField.jsx on lines 552..563
            src/platform/forms-system/src/js/fields/FileField.jsx on lines 561..572

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

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

                            {!file.uploading && (
                              <>
                                <strong
                                  id={fileNameId}
                                  className="dd-privacy-hidden"
            Severity: Major
            Found in src/applications/pre-need/components/FileField.jsx and 3 other locations - About 2 hrs to fix
            src/applications/appeals/shared/components/FileField.jsx on lines 524..535
            src/applications/simple-forms/40-0247/components/FileField.jsx on lines 552..563
            src/platform/forms-system/src/js/fields/FileField.jsx on lines 561..572

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

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

                            {!file.uploading && (
                              <>
                                <strong
                                  id={fileNameId}
                                  className="dd-privacy-hidden"
            src/applications/appeals/shared/components/FileField.jsx on lines 524..535
            src/applications/pre-need/components/FileField.jsx on lines 550..561
            src/platform/forms-system/src/js/fields/FileField.jsx on lines 561..572

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

            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

                  describe('updateFormHandler', () => {
                    it('should return the correct structure', () => {
                      const action = updateFormAction({
                        patientDemographicsStatus: {},
                      });
            src/applications/check-in/reducers/day-of/day-of.reducers.unit.spec.js on lines 224..233

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

            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 {
              uiSchema: {
                attendedSchoolLastYear: yesNoUI(
                  replaceStrValues(
                    content['household-dependent-attended-school-label'],
            src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/config/chapters/householdInformation/dependentEducationExpenses.js on lines 18..40

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

            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

            export default {
              title: 'Treatment from a VA medical center',
              path: 'medical/history/va-treatment',
              depends: () => !showMultiplePageResponse(),
              uiSchema: {
            src/applications/pensions/config/chapters/02-military-history/hasOtherNames.js on lines 11..29
            src/applications/pensions/config/chapters/05-financial-information/receivesIncome.js on lines 11..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 91.

            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