department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,759 of 12,759 total issues

Function transformForSubmit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function transformForSubmit(formConfig, form) {
  const remarksFormData = form.data.remarks;
  const remarksUiSchema =
    formConfig.chapters.additionalInformationChapter.pages.remarks.uiSchema;

Severity: Minor
Found in src/applications/simple-forms/26-4555/config/submit-transformer.js - About 1 hr to fix

    Function calculateExpenses has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        const calculateExpenses = async () => {
          if (!gmtData?.isEligibleForStreamlined) return;
    
          try {
            const response = await getMonthlyExpensesAPI(data);

      Function calculateExpenses has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          const calculateExpenses = async () => {
            if (!otherExpenses?.length || !gmtData?.isEligibleForStreamlined) return;
      
            try {
              const response = await getMonthlyExpensesAPI(data);

        Function content has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const content = () => {
            if (replyMessage === undefined) {
              return (
                <va-loading-indicator
                  message="Loading your secure message..."
        Severity: Minor
        Found in src/applications/mhv-secure-messaging/containers/MessageReply.jsx - About 1 hr to fix

          Function transformFormToAppointment has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function transformFormToAppointment(state) {
            const clinic = getChosenClinicInfo(state);
            const data = selectCovid19VaccineFormData(state);
          
            const slot = getChosenSlot(state);

            Function ScheduleNewAppointmentButton has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function ScheduleNewAppointmentButton() {
              const history = useHistory();
              const dispatch = useDispatch();
              const { typeOfCare } = useSelector(getNewAppointmentFlow);
              const featureStartSchedulingLink = useSelector(

              Function enter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  enter(path) {
                    if (isBlock(path)) {
                      const parent = stack[stack.length - 1];
                      const block = {
                        type: !parent ? 'Feature' : 'Background',
              Severity: Minor
              Found in src/applications/vaos/scripts/gherkin.js - About 1 hr to fix

                Function renderErrorMessages has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  renderErrorMessages() {
                    const {
                      claimsLoading,
                      appealsLoading,
                      stemClaimsLoading,
                Severity: Minor
                Found in src/applications/claims-status/containers/YourClaimsPageV2.jsx - About 1 hr to fix

                  Function makeLoadedCards has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const makeLoadedCards = () => {
                      setLoadedCards(
                        loaded.map((facilityCode, index) => {
                          return (
                            <li
                  Severity: Minor
                  Found in src/applications/gi/containers/CompareDrawer.jsx - About 1 hr to fix

                    Function default has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function(state = INITIAL_STATE, action) {
                      switch (action.type) {
                        case FETCH_CONSTANTS_STARTED:
                          return {
                            ...state,
                    Severity: Minor
                    Found in src/applications/gi/reducers/constants.js - About 1 hr to fix

                      Function disclaimerText has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const disclaimerText = () => {
                          return (
                            <>
                              <div>
                                <p>

                        Function deleteConnectedApp has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function deleteConnectedApp(appId) {
                          return async (dispatch, getState) => {
                            recordEvent({ event: 'profile-disconnect-connected-app-started' });
                            dispatch({ type: DELETING_CONNECTED_APP, appId });
                        
                        

                          Function vaProfile has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function vaProfile(state = initialState, action) {
                            switch (action.type) {
                              case FETCH_HERO_SUCCESS:
                              case FETCH_HERO_FAILED:
                                return set('hero', action.hero, state);
                          Severity: Minor
                          Found in src/applications/personalization/profile/reducers/vaProfile.js - About 1 hr to fix

                            Function ClaimantType has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const ClaimantType = props => {
                              const { router, setFormData } = props;
                            
                              const { data: formData } = useSelector(state => state.form);
                              const [localData, setLocalData] = useState({});
                            Severity: Minor
                            Found in src/applications/representative-appoint/components/ClaimantType.jsx - About 1 hr to fix

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

                              export const maxNameLength = (errors, data) => {
                                if (data.length > MAX_LENGTH.NOD_ISSUE_NAME) {
                                  errors.addError(errorMessages.maxLength(MAX_LENGTH.NOD_ISSUE_NAME));
                                }
                              };
                              Severity: Major
                              Found in src/applications/appeals/10182/validations/issues.js and 4 other locations - About 1 hr to fix
                              src/applications/appeals/995/validations/issues.js on lines 12..16
                              src/applications/appeals/996/validations/issues.js on lines 4..8
                              src/applications/appeals/testing/hlr/validations/issues.js on lines 4..8
                              src/applications/appeals/testing/sc/validations/issues.js on lines 12..16

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

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

                              export const maxNameLength = (error, data) => {
                                if (data.length > MAX_LENGTH.ISSUE_NAME) {
                                  error.addError(errorMessages.maxLength(MAX_LENGTH.ISSUE_NAME));
                                }
                              };
                              Severity: Major
                              Found in src/applications/appeals/testing/hlr/validations/issues.js and 4 other locations - About 1 hr to fix
                              src/applications/appeals/10182/validations/issues.js on lines 7..11
                              src/applications/appeals/995/validations/issues.js on lines 12..16
                              src/applications/appeals/996/validations/issues.js on lines 4..8
                              src/applications/appeals/testing/sc/validations/issues.js on lines 12..16

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

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

                              export const maxNameLength = (errors, data) => {
                                if (data.length > MAX_LENGTH.ISSUE_NAME) {
                                  errors.addError(errorMessages.maxLength(MAX_LENGTH.ISSUE_NAME));
                                }
                              };
                              Severity: Major
                              Found in src/applications/appeals/testing/sc/validations/issues.js and 4 other locations - About 1 hr to fix
                              src/applications/appeals/10182/validations/issues.js on lines 7..11
                              src/applications/appeals/995/validations/issues.js on lines 12..16
                              src/applications/appeals/996/validations/issues.js on lines 4..8
                              src/applications/appeals/testing/hlr/validations/issues.js on lines 4..8

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

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

                              export const maxNameLength = (errors, data) => {
                                if (data.length > MAX_LENGTH.ISSUE_NAME) {
                                  errors.addError(errorMessages.maxLength(MAX_LENGTH.ISSUE_NAME));
                                }
                              };
                              Severity: Major
                              Found in src/applications/appeals/995/validations/issues.js and 4 other locations - About 1 hr to fix
                              src/applications/appeals/10182/validations/issues.js on lines 7..11
                              src/applications/appeals/996/validations/issues.js on lines 4..8
                              src/applications/appeals/testing/hlr/validations/issues.js on lines 4..8
                              src/applications/appeals/testing/sc/validations/issues.js on lines 12..16

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

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

                              export const maxNameLength = (error, data) => {
                                if (data.length > MAX_LENGTH.ISSUE_NAME) {
                                  error.addError(errorMessages.maxLength(MAX_LENGTH.ISSUE_NAME));
                                }
                              };
                              Severity: Major
                              Found in src/applications/appeals/996/validations/issues.js and 4 other locations - About 1 hr to fix
                              src/applications/appeals/10182/validations/issues.js on lines 7..11
                              src/applications/appeals/995/validations/issues.js on lines 12..16
                              src/applications/appeals/testing/hlr/validations/issues.js on lines 4..8
                              src/applications/appeals/testing/sc/validations/issues.js on lines 12..16

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

                              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

                                      evidenceVaRecords: {
                                        title: 'VA medical records',
                                        path: EVIDENCE_VA_PATH,
                                        depends: hasVAEvidence,
                                        CustomPage: EvidenceVaRecords,
                              Severity: Major
                              Found in src/applications/appeals/testing/sc/config/form.js and 1 other location - About 1 hr to fix
                              src/applications/appeals/995/config/form.js on lines 226..236

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

                              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