department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

File CompareDrawer.jsx has 309 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import { useHistory } from 'react-router-dom';
import classNames from 'classnames';
import { removeCompareInstitution, compareDrawerOpened } from '../actions';
Severity: Minor
Found in src/applications/gi/containers/CompareDrawer.jsx - About 3 hrs to fix

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

      render() {
        const {
          uiSchema,
          errorSchema,
          idSchema,
    Severity: Major
    Found in src/platform/forms-system/src/js/fields/BasicArrayField.jsx - About 3 hrs to fix

      Function DynamicRadioWidget has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function DynamicRadioWidget(props) {
        const { onChange } = props;
        let locationsList = null;
        let upperContent = null;
        const [locations, setLocations] = useState([]);

        Function transformFormToVAOSCCRequest has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function transformFormToVAOSCCRequest(state) {
          const data = getFormData(state);
          const provider = data.communityCareProvider;
          const residentialAddress = selectVAPResidentialAddress(state);
          const parentFacility = getChosenCCSystemById(state);

          Function PreferredProviderSection has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function PreferredProviderSection(props) {
            const history = useHistory();
            const pageFlow = useSelector(getNewAppointmentFlow);
          
            return (

            Function CancelPageLayout has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function CancelPageLayout() {
              const { id } = useParams();
              const {
                appointment,
                bookingNotes,

              Function ReviewApproved has 85 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function ReviewApproved() {
                const history = useHistory();
                const dispatch = useDispatch();
                const storedFilterProvider = useSelector(selectProvider);
                const storedSortProviderBy = useSelector(selectProviderSortBy);
              Severity: Major
              Found in src/applications/vaos/referral-appointments/FilterPage.jsx - About 3 hrs to fix

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

                const writeJsonFile = (data, filepath) => {
                  fs.ensureFileSync(filepath);
                  fs.writeFile(filepath, JSON.stringify(data), err => {
                    if (err) {
                      error(`❌ Could not save file ${filepath}`);
                src/applications/_mock-form-ae-design-patterns/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/personalization/common/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/representative-appoint/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33

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

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

                const writeJsonFile = (data, filepath) => {
                  fs.ensureFileSync(filepath);
                  fs.writeFile(filepath, JSON.stringify(data), err => {
                    if (err) {
                      error(`❌ Could not save file ${filepath}`);
                src/applications/personalization/common/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/personalization/profile/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/representative-appoint/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33

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

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

                const writeJsonFile = (data, filepath) => {
                  fs.ensureFileSync(filepath);
                  fs.writeFile(filepath, JSON.stringify(data), err => {
                    if (err) {
                      error(`❌ Could not save file ${filepath}`);
                src/applications/_mock-form-ae-design-patterns/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/personalization/profile/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/representative-appoint/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33

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

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

                const writeJsonFile = (data, filepath) => {
                  fs.ensureFileSync(filepath);
                  fs.writeFile(filepath, JSON.stringify(data), err => {
                    if (err) {
                      error(`❌ Could not save file ${filepath}`);
                src/applications/_mock-form-ae-design-patterns/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/personalization/common/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33
                src/applications/personalization/profile/mocks/script/drupal-vamc-data/mockLocalDSOT.js on lines 23..33

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

                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

                PageNavigation.propTypes = {
                  content: PropTypes.shape({
                    addAnotherLink: PropTypes.string,
                    contentAfterButtons: PropTypes.element,
                    contentBeforeButtons: PropTypes.element,
                Severity: Major
                Found in src/applications/appeals/995/components/EvidenceRecords.jsx and 1 other location - About 3 hrs to fix
                src/applications/appeals/testing/sc/components/EvidenceRecords.jsx on lines 367..379

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

                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

                export default function get(path, object, defaultValue) {
                  const arrayPath = Array.isArray(path) ? path : deconstructPath(path);
                  checkValidPath(arrayPath);
                  const currentValue = arrayPath.reduce(
                    (current, next) =>
                Severity: Major
                Found in src/platform/utilities/data/get.js and 1 other location - About 3 hrs to fix
                src/platform/forms-system/src/js/utilities/data/get.js on lines 16..27

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

                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

                export default function get(path, object, defaultValue) {
                  const arrayPath = Array.isArray(path) ? path : deconstructPath(path);
                  checkValidPath(arrayPath);
                  const currentValue = arrayPath.reduce(
                    (current, next) =>
                Severity: Major
                Found in src/platform/forms-system/src/js/utilities/data/get.js and 1 other location - About 3 hrs to fix
                src/platform/utilities/data/get.js on lines 16..27

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

                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

                PageNavigation.propTypes = {
                  content: PropTypes.shape({
                    addAnotherLink: PropTypes.string,
                    contentAfterButtons: PropTypes.element,
                    contentBeforeButtons: PropTypes.element,
                src/applications/appeals/995/components/EvidenceRecords.jsx on lines 340..352

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

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

                            <li>
                              <button
                                className="usa-accordion-button va-footer-button"
                                aria-controls="veteran-connect"
                                itemProp="name"
                src/applications/proxy-rewrite/partials/mobile/footer/index.jsx on lines 67..84
                src/applications/proxy-rewrite/partials/mobile/footer/index.jsx on lines 85..102

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

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

                const treatmentDatePage = {
                  uiSchema: {
                    ...arrayBuilderItemSubsequentPageTitleUI(
                      ({ formData }) =>
                        `When did the claimant receive treatment at ${formData.facilityName}?`,
                src/applications/simple-forms/20-10207/pages/medicalTreatment.js on lines 70..90
                src/applications/simple-forms/20-10207/pages/medicalTreatmentThirdPartyVeteran.js on lines 71..91

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

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

                const treatmentDatePage = {
                  uiSchema: {
                    ...arrayBuilderItemSubsequentPageTitleUI(
                      ({ formData }) =>
                        `When did the Veteran receive treatment at ${formData.facilityName}?`,
                src/applications/simple-forms/20-10207/pages/medicalTreatment.js on lines 70..90
                src/applications/simple-forms/20-10207/pages/medicalTreatmentThirdPartyNonVeteran.js on lines 71..91

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

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

                            <li>
                              <button
                                className="usa-accordion-button va-footer-button"
                                aria-controls="footer-veteran-programs"
                                itemProp="name"
                src/applications/proxy-rewrite/partials/mobile/footer/index.jsx on lines 85..102
                src/applications/proxy-rewrite/partials/mobile/footer/index.jsx on lines 103..120

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

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

                  it('returns the most recent date when fieldDatetimeRangeTimezone is an array of 2 or more + there are past and future dates', () => {
                    const now = 1642019600;
                    const fieldDatetimeRangeTimezone = [
                      { value: 1642014000, endValue: 1642017600 },
                      { value: 1642017000, endValue: 1642020600 },
                src/applications/static-pages/events/helpers/index.unit.spec.js on lines 70..82
                src/applications/static-pages/events/helpers/index.unit.spec.js on lines 98..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 103.

                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