department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,717 of 12,717 total issues

Function getFacilityPageInfo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function getFacilityPageInfo(state) {
  const formInfo = getCovid19VaccineFormPageInfo(state, 'vaFacility');
  const data = selectCovid19VaccineFormData(state);
  const newBooking = selectCovid19VaccineNewBooking(state);

Severity: Minor
Found in src/applications/vaos/covid-19-vaccine/redux/selectors.js - About 1 hr to fix

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

    export function transformFormToAppointment(state) {
      const data = getFormData(state);
      const clinic = getChosenClinicInfo(state);
      const timezone = getTimezoneByFacilityId(data.vaFacility);
    
    

      Function otherCheckboxes has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function otherCheckboxes(
        handleVetTechPreferredProviderChange,
        options,
        smallScreen,
        automatedTest = false,
      Severity: Minor
      Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 1 hr to fix

        Function clearAllFilters has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const clearAllFilters = () => {
            dispatchFilterChange({
              ...filters,
              schools: true,
              excludedSchoolTypes: [
        Severity: Minor
        Found in src/applications/gi/components/ClearFiltersBtn.jsx - About 1 hr to fix

          Function searchResults has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const searchResults = (cnt, visible = true) => {
              if (cnt > 0) {
                const containerClassNames = classNames(
                  'location-search-results-container',
                  'usa-grid',
          Severity: Minor
          Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 1 hr to fix

            Function LoginAlert has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const LoginAlert = () => {
              const { ID_ME, LOGIN_GOV } = CSP_IDS;
              const heading = `Verify your identity with Login.gov or ID.me to change your direct deposit information online`;
              return (
                <VaAlert status="continue" visible uswds>

              Function yellowRibbonReducer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const yellowRibbonReducer = (state = initialState, action) => {
                switch (action.type) {
                  case FETCH_RESULTS: {
                    return {
                      ...state,
              Severity: Minor
              Found in src/applications/yellow-ribbon/reducers/index.js - About 1 hr to fix

                Function createApplications has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const createApplications = (updatedDaysAgo = 1) => {
                  const daysAgo = subDays(Date.now(), updatedDaysAgo);
                
                  return {
                    data: [

                  Function ItemList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const ItemList = props => {
                    const { list } = props;
                    if (typeof list === 'string')
                      return (
                        <span data-dd-privacy="mask" data-testid="item-list-string">
                  Severity: Minor
                  Found in src/applications/mhv-medical-records/components/shared/ItemList.jsx - About 1 hr to fix

                    Function VaccinesListItem has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const VaccinesListItem = props => {
                      const { record } = props;
                    
                      return (
                        <va-card

                      Function DownloadingRecordsInfo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DownloadingRecordsInfo = props => {
                        const { allowTxtDownloads } = props;
                      
                        const publicSharedContent = () => {
                          return (

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

                        export const validateAtLeastOneSelected = (errors, fieldData) => {
                          if (!Object.values(fieldData).some(val => val === true)) {
                            errors.addError('Select at least one option');
                          }
                        };
                        src/applications/disability-benefits/686c-674-v2/config/chapters/taskWizard/wizard/helpers.jsx on lines 22..26
                        src/applications/disability-benefits/686c-674/config/chapters/taskWizard/wizard/helpers.jsx on lines 50..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 61.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        export const schema = {
                          type: 'object',
                          properties: {
                            application: {
                              type: 'object',
                        src/applications/pre-need-integration/config/pages/sponsorMilitaryNameInformation.jsx on lines 43..58
                        src/applications/pre-need/config/pages/sponsorMilitaryNameInformation.jsx on lines 43..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 61.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        export const validateAtLeastOneSelected = (errors, fieldData) => {
                          if (!Object.values(fieldData).some(val => val === true)) {
                            errors.addError('Select at least one option');
                          }
                        };
                        src/applications/disability-benefits/686c-674-v2/config/chapters/taskWizard/wizard/helpers.jsx on lines 22..26
                        src/applications/vre/28-1900/config/chapters/communication-preferences/helpers.js on lines 30..34

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        export const schema = {
                          type: 'object',
                          properties: {
                            application: {
                              type: 'object',
                        src/applications/pre-need/config/pages/applicantMilitaryNameInformation.jsx on lines 41..56
                        src/applications/pre-need/config/pages/sponsorMilitaryNameInformation.jsx on lines 43..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 61.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        export const validateAtLeastOneSelected = (errors, fieldData) => {
                          if (!Object.values(fieldData).some(val => val === true)) {
                            errors.addError('Select at least one option');
                          }
                        };
                        src/applications/disability-benefits/686c-674/config/chapters/taskWizard/wizard/helpers.jsx on lines 50..54
                        src/applications/vre/28-1900/config/chapters/communication-preferences/helpers.js on lines 30..34

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                        export const schema = {
                          type: 'object',
                          properties: {
                            application: {
                              type: 'object',
                        src/applications/pre-need-integration/config/pages/sponsorMilitaryNameInformation.jsx on lines 43..58
                        src/applications/pre-need/config/pages/applicantMilitaryNameInformation.jsx on lines 41..56

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

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

                                    <div
                                      key={batterySupply.productId}
                                      className={classnames({
                                        'vads-u-background-color--gray-lightest vads-u-margin-bottom--2 vads-u-margin-top--3': true,
                                        'vads-u-border-color--primary vads-u-border--3px vads-u-padding--21 dd-privacy-mask': isBatterySelected(
                        src/applications/disability-benefits/2346/components/Accessories.jsx on lines 101..172
                        src/applications/disability-benefits/2346/components/Accessories.jsx on lines 153..169
                        src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 101..184
                        src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 155..168
                        src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 103..155
                        src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 103..170
                        src/applications/health-care-supply-reordering/components/Batteries.jsx on lines 111..173

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

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

                                              <label
                                                htmlFor={apneaSupply.productId}
                                                className={classnames({
                                                  'usa-button vads-u-font-weight--bold vads-u-border--2px vads-u-border-color--primary vads-u-text-align--left vads-u-padding-x--2': true,
                                                  'vads-u-color--white': isApneaSupplySelected(
                        src/applications/disability-benefits/2346/components/Accessories.jsx on lines 101..172
                        src/applications/disability-benefits/2346/components/Accessories.jsx on lines 153..169
                        src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 101..184
                        src/applications/disability-benefits/2346/components/Batteries.jsx on lines 109..190
                        src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 103..155
                        src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 103..170
                        src/applications/health-care-supply-reordering/components/Batteries.jsx on lines 111..173

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

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

                                    <div
                                      key={apneaSupply.productId}
                                      className={classnames({
                                        'vads-u-background-color--gray-lightest vads-u-margin-y--3': true,
                                        'vads-u-border-color--primary vads-u-border--3px vads-u-padding--21': isApneaSupplySelected(
                        src/applications/disability-benefits/2346/components/Accessories.jsx on lines 101..172
                        src/applications/disability-benefits/2346/components/Accessories.jsx on lines 153..169
                        src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 155..168
                        src/applications/disability-benefits/2346/components/Batteries.jsx on lines 109..190
                        src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 103..155
                        src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 103..170
                        src/applications/health-care-supply-reordering/components/Batteries.jsx on lines 111..173

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

                        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