department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,846 of 12,846 total issues

Function generateDocsFiled has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const generateDocsFiled = docsFiled => {
  return docsFiled.map(document => {
    if (document.id && document.status) {
      return {
        requestTypeText: `Request type: ${document.displayName}`,

    Function groupTimelineActivity has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function groupTimelineActivity(events) {
      const phases = {};
      let activity = [];
    
      const phaseEvents = events
    Severity: Minor
    Found in src/applications/claims-status/utils/helpers.js - About 1 hr to fix

      Function vetTecCheckbox has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const vetTecCheckbox = (
        vettec,
        preferredProvider,
        handleVetTecChange,
        handlePreferredProviderChange,
      Severity: Minor
      Found in src/applications/gi/containers/FilterYourResults.jsx - About 1 hr to fix

        Function addStatusToIssues has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function addStatusToIssues(issues) {
          return issues.map(issue => {
            let status = '';
            switch (issue.lastAction) {
              case ISSUE_STATUS.fieldGrant:
        Severity: Minor
        Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx - About 1 hr to fix

          Function handleCompareUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const handleCompareUpdate = e => {
              if (e.target.checked && !compareChecked) {
                if (compare.search.loaded.length === 3) {
                  recordEvent({
                    event: 'gibct-form-change',
          Severity: Minor
          Found in src/applications/gi/containers/ProfilePageHeader.jsx - About 1 hr to fix

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

              render() {
                return (
                  <div className="calculator-form">
                    <p>Use the fields below to update your benefits.</p>
                    {this.renderApprovedProgramsSelector()}

              Function otherCheckboxes has 27 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 handleScroll has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const handleScroll = () => {
                      const topOffset =
                        document
                          .getElementById('estimate-your-benefits-accordion')
                          ?.getBoundingClientRect().top -
                Severity: Minor
                Found in src/applications/gi/containers/CalculateYourBenefits.jsx - About 1 hr to fix

                  Function handleCompareUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const handleCompareUpdate = e => {
                      if (e.target.checked && !compareChecked) {
                        if (compareLength === 3) {
                          recordEvent({
                            event: 'gibct-form-change',
                  Severity: Minor
                  Found in src/applications/gi/containers/search/ResultCard.jsx - About 1 hr to fix

                    Function fetchSearchByNameResults has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function fetchSearchByNameResults(name, page, filters, version) {
                      const params = { name, page, ...rubyifyKeys(buildSearchFilters(filters)) };
                      if (version) {
                        params.version = version;
                      }
                    Severity: Minor
                    Found in src/applications/gi/actions/index.js - About 1 hr to fix

                      Function renderMilitaryDetails has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const renderMilitaryDetails = () => {
                          const name = 'Your military details';
                      
                          return (
                            <AccordionItem

                        Function FourthFAQSection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const FourthFAQSection = () => {
                          return (
                            <>
                              <h3 className="dhp-faq-section-header">Feedback</h3>
                              <va-accordion
                        Severity: Minor
                        Found in src/applications/dhp-connected-devices/components/FAQSections.jsx - About 1 hr to fix

                          Function handleSelectionChange has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const handleSelectionChange = selection => {
                              const highestRankTemp =
                                typeof selection === 'string' ? selection : selection.key;
                              if (selection.key)
                                setRank(`${selection.key.toUpperCase()} - ${selection.value}`);

                            Function editAddressSuccess has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              rest.post(`${prefix}/v0/profile/address_validation`, (req, res, ctx) => {
                                return res(
                                  ctx.json({
                                    addresses: [
                                      {
                            Severity: Minor
                            Found in src/applications/personalization/profile/msw-mocks.js - About 1 hr to fix

                              Function getClaims has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function getClaims() {
                                const startTimestampMs = Date.now();
                              
                                return dispatch => {
                                  dispatch({ type: FETCH_CLAIMS_PENDING });
                              Severity: Minor
                              Found in src/applications/personalization/dashboard/actions/claims.js - About 1 hr to fix

                                Function convertAdmissionAndDischargeDetails has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const convertAdmissionAndDischargeDetails = record => {
                                  const summary = getNote(record);
                                
                                  const admissionDate = getAdmissionDate(record, summary);
                                  const dischargeDate = getDischargeDate(record, summary);

                                  Function labAndTestDetails has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const labAndTestDetails = useMemo(() => {
                                      return {
                                        name: 'ANKLE LEFT 3 VIEWS',
                                        category: 'Radiology',
                                        orderedBy: 'DOE, JANE A',

                                    Function LastFilledInfo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const LastFilledInfo = rx => {
                                      const { dispStatus, orderedDate, sortedDispensedDate } = rx;
                                      let nonVA = false;
                                      let showLastFilledDate = false;
                                      if (dispStatus === dispStatusObj.nonVA) {

                                      Function ui:description has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          'ui:description': () => {
                                            return (
                                              <div className="vads-u-margin-y--3">
                                                <va-accordion uswds bordered open-single>
                                                  <va-accordion-item

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

                                        LogoRow.propTypes = {
                                          isMenuOpen: PropTypes.bool.isRequired,
                                          setIsMenuOpen: PropTypes.func.isRequired,
                                          showNavLogin: PropTypes.bool,
                                          updateExpandedMenuID: PropTypes.func,
                                        Severity: Major
                                        Found in src/platform/site-wide/header/components/LogoRow/index.js and 13 other locations - About 1 hr to fix
                                        src/applications/claims-status/components/ClaimCard/ClaimCardLink.jsx on lines 24..29
                                        src/applications/claims-status/components/appeals-v2/Decision.jsx on lines 102..107
                                        src/applications/financial-status-report/components/householdExpenses/CreditCardBillSummary.jsx on lines 147..152
                                        src/applications/financial-status-report/components/householdExpenses/InstallmentContractSummary.jsx on lines 191..196
                                        src/applications/personalization/dashboard/components/claims-and-appeals/Decision.jsx on lines 96..101
                                        src/applications/personalization/profile/components/ProfileLink.jsx on lines 57..62
                                        src/applications/personalization/profile/components/direct-deposit/vye/components/Buttons.jsx on lines 18..23
                                        src/applications/post-911-gib-status/containers/Main.jsx on lines 49..54
                                        src/applications/sco/components/HubRail/shared/liVaLinkAndVaTelephone.jsx on lines 21..26
                                        src/applications/simple-forms/20-10207/containers/App.jsx on lines 34..39
                                        src/applications/simple-forms/21-4138/containers/App.jsx on lines 34..39
                                        src/applications/verify-your-enrollment/components/Buttons.jsx on lines 22..27
                                        src/applications/check-in/components/ListWrapper.jsx on lines 20..25

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

                                        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