department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

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

        page18d: {
          path: 'applicant-child-adoption-file/:index',
          arrayPath: 'applicants',
          showPagePerItem: true,
          title: item => `${applicantWording(item)} adoption documents`,
Severity: Major
Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 6 hrs to fix
src/applications/ivc-champva/10-10D/config/form.js on lines 835..865
src/applications/ivc-champva/10-10D/config/form.js on lines 1193..1220

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

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

export default {
  uiSchema: {
    benefitSelection: checkboxGroupUI({
      title: 'Select the benefit you intend to file a claim for',
      required: true,
src/applications/simple-forms/21-0966/pages/thirdPartySurvivingDependentBenefitSelection.js on lines 9..53

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

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 visn23Facilities = [
  { name: 'Alexandria Community Based Outpatient Clinic', id: '656GC' },
  { name: 'Brainerd VA Clinic', id: '656GA' },
  { name: 'Fort Snelling VA Clinic', id: '618QA' },
  { name: 'Hayward VA Clinic', id: '618GH' },
Severity: Major
Found in src/applications/personalization/dashboard/covid-19.jsx and 1 other location - About 6 hrs to fix
src/platform/static-data/options-for-select.js on lines 9..23

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

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

export const branchesServed = [
  { value: 'air force', label: 'Air Force' },
  { value: 'army', label: 'Army' },
  { value: 'coast guard', label: 'Coast Guard' },
  { value: 'marine corps', label: 'Marine Corps' },
Severity: Major
Found in src/platform/static-data/options-for-select.js and 1 other location - About 6 hrs to fix
src/applications/personalization/dashboard/covid-19.jsx on lines 97..111

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

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

export default {
  uiSchema: {
    benefitSelection: checkboxGroupUI({
      title: 'Select the benefit the claimant intends to file a claim for',
      required: true,
src/applications/simple-forms/21-0966/pages/survivingDependentBenefitSelection.js on lines 9..53

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

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

File ArrayBuilderSummaryPage.jsx has 435 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable react/sort-prop-types */
import React, { useEffect, useRef, useState } from 'react';
import { connect } from 'react-redux';
import { focusElement, scrollAndFocus } from 'platform/utilities/ui';

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

      render() {
        return (
          <div>
            <p>
              Based on your goals and experiences, we recommend exploring the

      Function Error has 161 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Error = () => {
        const { t } = useTranslation();
        const selectError = useMemo(makeSelectError, []);
        const { error } = useSelector(selectError);
      
      
      Severity: Major
      Found in src/applications/check-in/travel-claim/pages/error/index.jsx - About 6 hrs to fix

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

          render() {
            const { supplies, order, eligibility } = this.props;
            const currentDate = moment();
            const apneaSupplies = supplies.filter(
              supply => supply.productGroup === APNEA,

          Function NoFormPage has 160 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const NoFormPage = () => {
            const [data, setData] = useState({});
            const [loading, setLoading] = useState(true);
            const loggedIn = useSelector(isLoggedIn);
          
          
          Severity: Major
          Found in src/applications/burials-ez/components/NoFormPage.jsx - About 6 hrs to fix

            Function MessageList has 160 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const MessageList = props => {
              const dispatch = useDispatch();
              const { folder, messages, keyword, isSearch, sortOrder, page } = props;
              const perPage = 10;
              const totalEntries = messages?.length;

              Function ThreadDetails has 160 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const ThreadDetails = props => {
                const { threadId } = useParams();
                const { testing } = props;
                const dispatch = useDispatch();
                const location = useLocation();
              Severity: Major
              Found in src/applications/mhv-secure-messaging/containers/ThreadDetails.jsx - About 6 hrs to fix

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

                  constructor(props) {
                    super(props);
                    this.state = this.getStateFromProps(props);
                    this.onPropertyChange = this.onPropertyChange.bind(this);
                    this.onPropertyBlur = this.onPropertyBlur.bind(this);
                Severity: Major
                Found in src/platform/forms-system/src/js/fields/ObjectField.jsx and 1 other location - About 6 hrs to fix
                src/platform/user/profile/vap-svc/components/DeselectableObjectField.jsx on lines 97..110

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

                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

                    function guessesForUserOffsets (offsets) {
                        var offsetsLength = offsets.length,
                            filteredGuesses = {},
                            out = [],
                            i, j, guessesOffset;
                Severity: Major
                Found in src/applications/vaos/lib/moment-tz.js and 1 other location - About 6 hrs to fix
                src/applications/personalization/dashboard/lib/moment-tz.js on lines 324..348

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

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

                export const App = ({
                  authenticatedWithSSOe,
                  ehrDataByVhaId,
                  facilities,
                  useSingleLogout,
                src/applications/static-pages/health-care-manage-benefits/get-medical-records-page/components/App/index.js on lines 18..41
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/App/index.js on lines 19..42
                src/applications/static-pages/health-care-manage-benefits/view-test-and-lab-results-page/components/App/index.js on lines 19..42

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

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

                export const App = ({
                  authenticatedWithSSOe,
                  ehrDataByVhaId,
                  facilities,
                  useSingleLogout,
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/App/index.js on lines 19..42
                src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/App/index.js on lines 19..42
                src/applications/static-pages/health-care-manage-benefits/view-test-and-lab-results-page/components/App/index.js on lines 19..42

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

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

                export const App = ({
                  authenticatedWithSSOe,
                  ehrDataByVhaId,
                  facilities,
                  useSingleLogout,
                src/applications/static-pages/health-care-manage-benefits/get-medical-records-page/components/App/index.js on lines 18..41
                src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/App/index.js on lines 19..42
                src/applications/static-pages/health-care-manage-benefits/view-test-and-lab-results-page/components/App/index.js on lines 19..42

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

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

                export const App = ({
                  authenticatedWithSSOe,
                  ehrDataByVhaId,
                  facilities,
                  useSingleLogout,
                src/applications/static-pages/health-care-manage-benefits/get-medical-records-page/components/App/index.js on lines 18..41
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/App/index.js on lines 19..42
                src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/App/index.js on lines 19..42

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

                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

                  function guessesForUserOffsets(offsets) {
                    var offsetsLength = offsets.length,
                      filteredGuesses = {},
                      out = [],
                      i,
                Severity: Major
                Found in src/applications/personalization/dashboard/lib/moment-tz.js and 1 other location - About 6 hrs to fix
                src/applications/vaos/lib/moment-tz.js on lines 310..332

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

                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

                  constructor(props) {
                    super(props);
                    this.state = this.getStateFromProps(props);
                    this.onPropertyChange = this.onPropertyChange.bind(this);
                    this.onPropertyBlur = this.onPropertyBlur.bind(this);
                src/platform/forms-system/src/js/fields/ObjectField.jsx on lines 54..67

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

                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