department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,805 of 12,805 total issues

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

        {batterySupplies.length > 0 && (
          <va-additional-info trigger="What if my device isn’t listed here?">
            <p>
              Your hearing aid device may not be listed here if you haven’t
              placed an order for resupply items within the last 2 years. If you
src/applications/disability-benefits/2346/components/Batteries.jsx on lines 192..223

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

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

        <ul className="disagreement-list vads-u-padding--0">
          {data.areaOfDisagreement.map((issue, index) => (
            <li key={index}>
              <strong>{getIssueName(issue)}</strong>
              <div>
src/applications/appeals/testing/download/containers/ViewAppeal.jsx on lines 159..170

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

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

) => async dispatch => {
  const userEnteredAddress = { ...inputAddress };
  dispatch({
    type: ADDRESS_VALIDATION_INITIALIZE,
    fieldName,
Severity: Major
Found in src/platform/user/profile/vap-svc/actions/transactions.js - About 4 hrs to fix

    Function IntroductionPage has 116 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const IntroductionPage = props => {
      // Toggle from hearing aid supplies to hearing aid + CPAP supplies.
      const {
        TOGGLE_NAMES,
        useToggleValue,

      Function prefillTransformerV2 has 116 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function prefillTransformerV2(pages, formData, metadata, state) {
        const bankInformation = state.data?.bankInformation || {};
        const claimant = state.data?.formData?.data?.attributes?.claimant || {};
        const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
        const contactInfo = claimant?.contactInfo || {};
      Severity: Major
      Found in src/applications/my-education-benefits/helpers.js - About 4 hrs to fix

        Function prefillTransformerV2 has 116 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function prefillTransformerV2(pages, formData, metadata, state) {
          const bankInformation = state.data?.bankInformation || {};
          const claimant = state.data?.formData?.data?.attributes?.claimant || {};
          const contactInfo = claimant?.contactInfo || {};
          const sponsors = state.data?.formData?.attributes?.sponsors;
        Severity: Major
        Found in src/applications/toe/helpers.jsx - About 4 hrs to fix

          Function IntroductionPage has 116 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const IntroductionPage = props => {
            // Toggle from hearing aid supplies to hearing aid + CPAP supplies.
            const {
              TOGGLE_NAMES,
              useToggleValue,

            Function PayrollDeductionChecklist has 116 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const PayrollDeductionChecklist = props => {
              const { goToPath, goBack, setFormData } = props;
            
              const editIndex = getJobIndex();
            
            

              Function PrintDownload has 116 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const PrintDownload = props => {
                const { downloadPdf, downloadTxt, list, allowTxtDownloads } = props;
                const menu = useRef(null);
              
                const [menuOpen, setMenuOpen] = useState(false);

                File mockData.js has 359 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                export const UPDATED_USER_MOCK_DATA = {
                  'vye::UserInfo': {
                    remEnt: '2854321', // 28(first 2 numbers) for months .54321 * 30 = res needs to be rounded
                    certIssueDate: '2019-06-28T00:00:00.000Z',
                    delDate: '2026-09-03T00:00:00.000Z',
                Severity: Minor
                Found in src/applications/verify-your-enrollment/constants/mockData.js - About 4 hrs to fix

                  Function determineVenueAddress has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const determineVenueAddress = (formResponses, noDRB) => {
                    if (!formResponses) return null;
                  
                    const boardData = determineBoardObj(formResponses);
                  
                  
                  Severity: Major
                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 4 hrs to fix

                    Function venueAddress has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const venueAddress = (formValues, noDRB) => {
                      if (!formValues) return null;
                    
                      const boardData = board(formValues);
                    
                    
                    Severity: Major
                    Found in src/applications/discharge-wizard/helpers/index.jsx - About 4 hrs to fix

                      Function DocumentUploader has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DocumentUploader = () => {
                        const [state, setState] = useState({
                          documentType: '',
                          documentDescription: '',
                          errorMessage: null,

                        Function DocumentUploader has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const DocumentUploader = () => {
                          const [state, setState] = useState({
                            documentType: '',
                            documentDescription: '',
                            errorMessage: null,

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

                          export default function transformForSubmit(formConfig, form) {
                            const hasReceivedMedicalTreatment =
                              form?.data?.['view:hasReceivedMedicalTreatment'];
                          
                            const transformedData = JSON.parse(
                          Severity: Major
                          Found in src/applications/simple-forms/20-10207/config/submit-transformer.js - About 4 hrs to fix

                            Function SpousePayrollDeductionChecklist has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const SpousePayrollDeductionChecklist = props => {
                              const { goToPath, goBack, setFormData } = props;
                            
                              const editIndex = getJobIndex();
                            
                            

                              Function RadioWidget has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function RadioWidget(props) {
                                const { options, formContext = {}, value, disabled, onChange, id } = props;
                                const { enumOptions, labels = {} } = options;
                              
                                const dispatch = useDispatch();

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

                                              <li
                                                className="process-step list-three"
                                                itemProp="steps"
                                                itemScope
                                                itemType="http://schema.org/HowToSection"
                                src/applications/edu-benefits/1995/containers/IntroductionPage.jsx on lines 115..137

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 127.

                                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 MedicareClaimNumberDescription = (
                                  <>
                                    <va-additional-info
                                      trigger="Why we ask for this information"
                                      class="vads-u-margin-top--3 vads-u-margin-bottom--4 hydrated"
                                src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/MedicareClaimNumberDescription.jsx on lines 3..35

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

                                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 MedicareClaimNumberDescription = (
                                  <>
                                    <va-additional-info
                                      trigger="Why we ask for this information"
                                      class="vads-u-margin-top--3 vads-u-margin-bottom--4 hydrated"
                                src/applications/ezr/components/FormDescriptions/MedicareClaimNumberDescription.jsx on lines 3..35

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

                                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