department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,851 of 12,851 total issues

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

  const inProgressClaims = [
    ...claimsV2Root.appeals,
    ...claimsV2Root.claims,
    ...stemClaims,
  ]
src/applications/claims-status/containers/YourClaimsPageV2.jsx on lines 302..312

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

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

      [`ptsdAdditionalEvents${index}`]: {
        title: 'Add another event or situation?',
        path: `disabilities/ptsd-additional-events-${index}`,
        depends: isAnswering781Questions(index),
        uiSchema: ptsdAdditionalEvents.uiSchema(index),
src/applications/disability-benefits/all-claims/config/781/index.js on lines 330..336

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

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

const profileToggles = {
  authExpVbaDowntimeMessage: false,
  profileShowPronounsAndSexualOrientation: false,
  profileHideDirectDeposit: false,
  profileShowPaymentsNotificationSetting: false,
src/applications/personalization/profile/mocks/server.js on lines 93..108

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

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

    () => {
      if (
        !isInitialLoad &&
        !loadingSlots &&
        appointmentSlotsStatus !== FETCH_STATUS.failed
src/applications/vaos/covid-19-vaccine/components/SelectDate1Page.jsx on lines 126..139

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

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

const {
  address: applicantAddress,
  applicantEmail,
  educationDetails,
  fullName,
Severity: Major
Found in src/applications/edu-benefits/feedback-tool/config/form.js and 1 other location - About 1 hr to fix
src/applications/pensions/config/definitions.js on lines 13..26

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

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

                  <p>
                    We’re working to bring your medical records to VA.gov. For
                    now, you can download your records using the previous
                    version of My HealtheVet.{' '}
                    <a
src/applications/mhv-landing-page/components/HeaderLayout.jsx on lines 69..83

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

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

      if (fragmentAfter.childNodes.length > 0) {
        const newUlAfter = document.createElement('ul');
        while (fragmentAfter.firstChild) {
          newUlAfter.appendChild(fragmentAfter.firstChild);
        }
Severity: Major
Found in src/applications/mhv-medications/util/helpers.js and 1 other location - About 1 hr to fix
src/applications/mhv-medications/util/helpers.js on lines 387..395

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

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

  const sortFunc = (a, b) => {
    if (sortField === 'SENT_DATE') {
      if (sortOrder === 'DESC') {
        return compareDesc(
          new Date(a.attributes.sentDate),
Severity: Minor
Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 1 hr to fix

    Function ClientError has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function ClientError(props) {
      const { buttonText, formConfig, onBack, onSubmit, testId } = props;
      const { Element } = Scroll;
      const scrollToError = () => {
        scrollTo('errorScrollElement', getScrollOptions());

      Function ValidationError has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ValidationError(props) {
        const { appType, buttonText, formConfig, onBack, onSubmit, testId } = props;
        let ariaDescribedBy = null;
        // If no ariaDescribedBy is passed down from form.js,
        // a null value will properly not render the aria label.

        Function ConfirmationPage has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const ConfirmationPage = () => {
          resetStoredSubTask();
        
          return (
            <ConfirmationDecisionReviews
        Severity: Minor
        Found in src/applications/appeals/996/containers/ConfirmationPage.jsx - About 1 hr to fix

          Function GET /covid_vaccine/v0/facilities/:zip has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            'GET /covid_vaccine/v0/facilities/:zip': (req, res) => {
              return res.status(200).json({
                data: [
                  {
                    id: 'vha_516',

            Function benefitsEligibilityUpdate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const benefitsEligibilityUpdate = benefitsEligibilityBox => {
              const uiSchema = {
                'ui:description': benefitsEligibilityBox,
                'view:selectedBenefits': {
                  'ui:title': 'Select the benefit that is the best match for you.',

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

                render() {
                  const { form } = this.props;
                  const { formId, data, submission } = form;
                  const submitDate = new Date(submission?.timestamp);
              
              
              Severity: Minor
              Found in src/applications/edu-benefits/10215/containers/ConfirmationPage.jsx - About 1 hr to fix

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

                  render() {
                    const { form } = this.props;
                    const { submission, formId, data } = form;
                    const submitDate = new Date(submission?.timestamp);
                    const { fullName } = data;
                Severity: Minor
                Found in src/applications/edu-benefits/10216/containers/ConfirmationPage.jsx - About 1 hr to fix

                  Function combineEnrollmentsWithStartMonth has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const combineEnrollmentsWithStartMonth = enrollmentPeriods => {
                    const isArray = Array.isArray(enrollmentPeriods);
                  
                    const trackDate = [];
                    const combineMonths = {};
                  Severity: Minor
                  Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                    Function getCards has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const getCards = () => {
                        const combinedEnrollmentsObj = combineEnrollmentsWithStartMonth(
                          enrollmentPeriods,
                        );
                        const combinedEnrollmentsValues = Object.values(

                      Function genSearchAreaFromCenter has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const genSearchAreaFromCenter = query => {
                        const { lat, lng, currentBounds } = query;
                        return dispatch => {
                          const types = MAPBOX_QUERY_TYPES;
                          mbxClient

                        Function appointments has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const appointments = avs => {
                          if (avs.appointments?.length > 0) {
                            const scheduledAppointments = getAppointmentContent(
                              APPOINTMENT_TYPES.SCHEDULED,
                              avs.appointments,
                        Severity: Minor
                        Found in src/applications/avs/components/YourHealthInformation.jsx - About 1 hr to fix

                          Function createFutureEvents has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const createFutureEvents = () => {
                            // Types: upcoming, next-month, next-week
                            return [
                              // upcoming
                              createEvent(
                          Severity: Minor
                          Found in src/applications/static-pages/events/helpers/event-generator.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language