department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,820 of 12,820 total issues

Function ViewDependentsListItem has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ViewDependentsListItem(props) {
  const [open, setOpen] = useState(false);

  const {
    manageDependentsToggle,

    Function NextStepsPage has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function NextStepsPage() {
      const { data: formData } = useSelector(state => state.form);
      const repType =
        formData['view:selectedRepresentative'].attributes?.individualType;
      const address = {
    Severity: Major
    Found in src/applications/representative-appoint/containers/NextStepsPage.jsx - About 3 hrs to fix

      File index.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import moment from 'moment-timezone';
      import { isArray, sortBy, filter, isEmpty } from 'lodash';
      
      export const filterByOptions = [
        {
      Severity: Minor
      Found in src/applications/static-pages/events/helpers/index.js - About 3 hrs to fix

        Function ContactInfo has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

        const ContactInfo = ({
          data,
          goBack,
          goForward,
          onReviewPage,
        Severity: Minor
        Found in src/platform/forms-system/src/js/components/ContactInfo.jsx - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function ContestableIssues has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

        const ContestableIssues = props => {
          const {
            id,
            options,
            formContext = {},
        Severity: Minor
        Found in src/applications/appeals/shared/components/ContestableIssues.jsx - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

          const closeRemoveModal = ({ remove = false } = {}) => {
            const idx = removeIndex;
            setRemoveIndex(null);
            setShowRemoveModal(false);
            if (remove) {
        src/applications/appeals/shared/components/FileField.jsx on lines 322..337
        src/applications/pre-need/components/FileField.jsx on lines 370..385
        src/platform/forms-system/src/js/fields/FileField.jsx on lines 369..384

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

        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 closeRemoveModal = ({ remove = false } = {}) => {
            const idx = removeIndex;
            setRemoveIndex(null);
            setShowRemoveModal(false);
            if (remove) {
        Severity: Major
        Found in src/platform/forms-system/src/js/fields/FileField.jsx and 3 other locations - About 3 hrs to fix
        src/applications/appeals/shared/components/FileField.jsx on lines 322..337
        src/applications/pre-need/components/FileField.jsx on lines 370..385
        src/applications/simple-forms/40-0247/components/FileField.jsx on lines 382..397

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

        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 closeRemoveModal = ({ remove = false } = {}) => {
            const idx = removeIndex;
            setRemoveIndex(null);
            setShowRemoveModal(false);
            if (remove) {
        Severity: Major
        Found in src/applications/appeals/shared/components/FileField.jsx and 3 other locations - About 3 hrs to fix
        src/applications/pre-need/components/FileField.jsx on lines 370..385
        src/applications/simple-forms/40-0247/components/FileField.jsx on lines 382..397
        src/platform/forms-system/src/js/fields/FileField.jsx on lines 369..384

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

        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 closeRemoveModal = ({ remove = false } = {}) => {
            const idx = removeIndex;
            setRemoveIndex(null);
            setShowRemoveModal(false);
            if (remove) {
        Severity: Major
        Found in src/applications/pre-need/components/FileField.jsx and 3 other locations - About 3 hrs to fix
        src/applications/appeals/shared/components/FileField.jsx on lines 322..337
        src/applications/simple-forms/40-0247/components/FileField.jsx on lines 382..397
        src/platform/forms-system/src/js/fields/FileField.jsx on lines 369..384

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

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

        const App = ({ formEnabled }) => {
          if (formEnabled === undefined) {
            return <va-loading-indicator message="Loading..." />;
          }
        
        
        Severity: Major
        Found in src/applications/static-pages/simple-forms/20-10207/App.js and 6 other locations - About 3 hrs to fix
        src/applications/static-pages/simple-forms/20-10206/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0845/App.js on lines 8..29
        src/applications/static-pages/simple-forms/21-0966/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0972/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-10210/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-4138/App.js on lines 8..28

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

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

        const App = ({ formEnabled }) => {
          if (formEnabled === undefined) {
            return <va-loading-indicator message="Loading..." />;
          }
        
        
        Severity: Major
        Found in src/applications/static-pages/simple-forms/20-10206/App.js and 6 other locations - About 3 hrs to fix
        src/applications/static-pages/simple-forms/20-10207/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0845/App.js on lines 8..29
        src/applications/static-pages/simple-forms/21-0966/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0972/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-10210/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-4138/App.js on lines 8..28

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

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

        const App = ({ formEnabled }) => {
          if (formEnabled === undefined) {
            return <va-loading-indicator message="Loading..." />;
          }
        
        
        Severity: Major
        Found in src/applications/static-pages/simple-forms/21-10210/App.js and 6 other locations - About 3 hrs to fix
        src/applications/static-pages/simple-forms/20-10206/App.js on lines 8..28
        src/applications/static-pages/simple-forms/20-10207/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0845/App.js on lines 8..29
        src/applications/static-pages/simple-forms/21-0966/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0972/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-4138/App.js on lines 8..28

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

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

        const App = ({ formEnabled }) => {
          if (formEnabled === undefined) {
            return <va-loading-indicator message="Loading..." />;
          }
        
        
        Severity: Major
        Found in src/applications/static-pages/simple-forms/21-0966/App.js and 6 other locations - About 3 hrs to fix
        src/applications/static-pages/simple-forms/20-10206/App.js on lines 8..28
        src/applications/static-pages/simple-forms/20-10207/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0845/App.js on lines 8..29
        src/applications/static-pages/simple-forms/21-0972/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-10210/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-4138/App.js on lines 8..28

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

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

        const App = ({ formEnabled }) => {
          if (formEnabled === undefined) {
            return <va-loading-indicator message="Loading..." />;
          }
        
        
        Severity: Major
        Found in src/applications/static-pages/simple-forms/21-4138/App.js and 6 other locations - About 3 hrs to fix
        src/applications/static-pages/simple-forms/20-10206/App.js on lines 8..28
        src/applications/static-pages/simple-forms/20-10207/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0845/App.js on lines 8..29
        src/applications/static-pages/simple-forms/21-0966/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0972/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-10210/App.js on lines 8..28

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

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

        const App = ({ formEnabled }) => {
          if (formEnabled === undefined) {
            return <va-loading-indicator message="Loading..." />;
          }
        
        
        Severity: Major
        Found in src/applications/static-pages/simple-forms/21-0972/App.js and 6 other locations - About 3 hrs to fix
        src/applications/static-pages/simple-forms/20-10206/App.js on lines 8..28
        src/applications/static-pages/simple-forms/20-10207/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0845/App.js on lines 8..29
        src/applications/static-pages/simple-forms/21-0966/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-10210/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-4138/App.js on lines 8..28

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

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

        const App = ({ formEnabled }) => {
          if (formEnabled === undefined) {
            return <va-loading-indicator message="Loading..." />;
          }
        
        
        Severity: Major
        Found in src/applications/static-pages/simple-forms/21-0845/App.js and 6 other locations - About 3 hrs to fix
        src/applications/static-pages/simple-forms/20-10206/App.js on lines 8..28
        src/applications/static-pages/simple-forms/20-10207/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0966/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-0972/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-10210/App.js on lines 8..28
        src/applications/static-pages/simple-forms/21-4138/App.js on lines 8..28

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

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

                  {
                    resourceType: 'Specimen',
                    id: 'Specimen-0',
                    meta: {
                      profile: [
        src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 1382..1415
        src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2902..2935
        src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 3161..3194
        src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 3764..3797
        src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 4030..4063

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

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

            case Actions.CareSummariesAndNotes.COPY_UPDATED_LIST: {
              const originalList = state.careSummariesAndNotesList;
              const { updatedList } = state;
              if (
                Array.isArray(originalList) &&
        src/applications/mhv-medical-records/reducers/allergies.js on lines 112..129
        src/applications/mhv-medical-records/reducers/conditions.js on lines 127..144
        src/applications/mhv-medical-records/reducers/labsAndTests.js on lines 447..464
        src/applications/mhv-medical-records/reducers/vaccines.js on lines 152..169
        src/applications/mhv-medical-records/reducers/vitals.js on lines 119..136

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

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

            case Actions.Vaccines.COPY_UPDATED_LIST: {
              const originalList = state.vaccinesList;
              const { updatedList } = state;
              if (
                Array.isArray(originalList) &&
        Severity: Major
        Found in src/applications/mhv-medical-records/reducers/vaccines.js and 5 other locations - About 3 hrs to fix
        src/applications/mhv-medical-records/reducers/allergies.js on lines 112..129
        src/applications/mhv-medical-records/reducers/careSummariesAndNotes.js on lines 283..300
        src/applications/mhv-medical-records/reducers/conditions.js on lines 127..144
        src/applications/mhv-medical-records/reducers/labsAndTests.js on lines 447..464
        src/applications/mhv-medical-records/reducers/vitals.js on lines 119..136

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

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

            case Actions.Vitals.COPY_UPDATED_LIST: {
              const originalList = state.vitalsList;
              const { updatedList } = state;
              if (
                Array.isArray(originalList) &&
        Severity: Major
        Found in src/applications/mhv-medical-records/reducers/vitals.js and 5 other locations - About 3 hrs to fix
        src/applications/mhv-medical-records/reducers/allergies.js on lines 112..129
        src/applications/mhv-medical-records/reducers/careSummariesAndNotes.js on lines 283..300
        src/applications/mhv-medical-records/reducers/conditions.js on lines 127..144
        src/applications/mhv-medical-records/reducers/labsAndTests.js on lines 447..464
        src/applications/mhv-medical-records/reducers/vaccines.js on lines 152..169

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

        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