department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,759 of 12,759 total issues

Function validateSearchTermSubmit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const validateSearchTermSubmit = (
  searchTerm,
  dispatchError,
  error,
  filters,
Severity: Minor
Found in src/applications/gi/utils/helpers.js - About 1 hr 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 CalculatorSheetResultRow has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export default function CalculatorSheetResultRow({
  id,
  label,
  value,
  header,
Severity: Minor
Found in src/applications/gi/components/profile/CalculatorSheetResultRow.jsx - About 1 hr 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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { idSchema, formContext, formData, uiSchema, schema } = this.props;
    const id = idSchema.$id;

    // wrap matching text in a <span> element

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 getInput has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function getInput(input, uiSchema, schema) {
  if (input && input.widget === 'autosuggest') {
    return input.label;
  }

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 RadioWidget has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export default function RadioWidget(props) {
  const { options, formContext = {}, value, disabled, onChange, id } = props;
  const { enumOptions, labels = {} } = options;

  const onReviewPage = formContext?.onReviewPage || false;

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 extractObservedReported has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const extractObservedReported = allergy => {
  if (allergy && isArrayAndHasItems(allergy.extension)) {
    const extItem = allergy.extension.find(
      item => item.url && item.url.includes('allergyObservedHistoric'),
    );
Severity: Minor
Found in src/applications/mhv-medical-records/reducers/allergies.js - About 1 hr 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 Vitals has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const Vitals = () => {
  const dispatch = useDispatch();
  const updatedRecordList = useSelector(state => state.mr.vitals.updatedList);
  const listState = useSelector(state => state.mr.vitals.listState);
  const vitals = useSelector(state => state.mr.vitals.vitalsList);
Severity: Minor
Found in src/applications/mhv-medical-records/containers/Vitals.jsx - About 1 hr 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 ConfirmationPage has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export default function ConfirmationPage({ router }) {
  const [signedForm, setSignedForm] = useState(false);
  const [signedFormError, setSignedFormError] = useState(false);
  const { data: formData } = useSelector(state => state.form);
  const selectedEntity = formData['view:selectedRepresentative'];

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 SelectAccreditedRepresentative has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const SelectAccreditedRepresentative = props => {
  const { setFormData, formData, router, routes, location } = props;
  const [query, setQuery] = useState('');
  const [loading, setLoading] = useState(false);
  const [error, setError] = useState(null);

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 extractObservedReported has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const extractObservedReported = allergy => {
  if (allergy && isArrayAndHasItems(allergy.extension)) {
    const extItem = allergy.extension.find(
      item => item.url && item.url.includes('allergyObservedHistoric'),
    );
Severity: Minor
Found in src/applications/mhv-medications/reducers/allergies.js - About 1 hr 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 CernerFacilityAlert has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const CernerFacilityAlert = ({ className = '' }) => {
  const ehrDataByVhaId = useSelector(
    state => state.drupalStaticData?.vamcEhrData?.data?.ehrDataByVhaId,
  );
  const userFacilities = useSelector(state => state?.user?.profile?.facilities);

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

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

ConfirmCancelModal.propTypes = {
  closeModal: PropTypes.func.isRequired,
  isVisible: PropTypes.bool.isRequired,
  onHide: PropTypes.func.isRequired,
  activeSection: PropTypes.string,
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

RemoveFileModal.propTypes = {
  closeModal: PropTypes.func.isRequired,
  removeFile: PropTypes.func.isRequired,
  showRemoveFileModal: PropTypes.bool.isRequired,
  removeFileName: PropTypes.string,
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

SearchResultsPage.propTypes = {
  hasFetchedOnce: PropTypes.bool.isRequired,
  showMobileForm: PropTypes.bool.isRequired,
  toggleShowMobileForm: PropTypes.func.isRequired,
  totalResults: PropTypes.number,
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

SpouseEmploymentHistoryWidget.propTypes = {
  goBack: PropTypes.func.isRequired,
  goForward: PropTypes.func.isRequired,
  goToPath: PropTypes.func.isRequired,
  onReviewPage: PropTypes.bool,
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

SpouseGrossMonthlyIncomeInput.propTypes = {
  goBack: PropTypes.func.isRequired,
  goToPath: PropTypes.func.isRequired,
  setFormData: PropTypes.func.isRequired,
  onReviewPage: PropTypes.bool,
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

ClaimPhaseStepper.propTypes = {
  claimDate: PropTypes.string.isRequired,
  currentClaimPhaseDate: PropTypes.string.isRequired,
  currentPhase: PropTypes.number.isRequired,
  currentPhaseBack: PropTypes.bool,
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

CompareScroller.propTypes = {
  currentScroll: PropTypes.number.isRequired,
  divisionWidth: PropTypes.number.isRequired,
  divisions: PropTypes.number.isRequired,
  onClick: PropTypes.func,
Severity: Major
Found in src/applications/gi/components/CompareScroller.jsx and 12 other locations - About 1 hr to fix
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

CompareCheckbox.propTypes = {
  compareChecked: PropTypes.bool.isRequired,
  handleCompareUpdate: PropTypes.func.isRequired,
  institution: PropTypes.string.isRequired,
  cityState: PropTypes.string,
Severity: Major
Found in src/applications/gi/components/CompareCheckbox.jsx and 12 other locations - About 1 hr to fix
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/PayrollDeductionInputList.jsx on lines 245..250
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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

PayrollDeductionInputList.propTypes = {
  goBack: PropTypes.func.isRequired,
  goToPath: PropTypes.func.isRequired,
  setFormData: PropTypes.func.isRequired,
  onReviewPage: PropTypes.bool,
src/applications/check-in/travel-claim/pages/travel-mileage/MultiAppointmentBody.jsx on lines 64..69
src/applications/claims-status/components/appeals-v2/PastEvent.jsx on lines 18..23
src/applications/claims-status/components/claim-files-tab/RemoveFileModal.jsx on lines 40..45
src/applications/claims-status/components/claim-overview-tab/ClaimPhaseStepper.jsx on lines 243..248
src/applications/financial-status-report/components/employment/SpouseEmploymentHistoryWidget.jsx on lines 79..84
src/applications/financial-status-report/components/householdIncome/GrossMonthlyIncomeInput.jsx on lines 197..202
src/applications/financial-status-report/components/householdIncome/SpouseGrossMonthlyIncomeInput.jsx on lines 199..204
src/applications/gi/components/CompareCheckbox.jsx on lines 26..31
src/applications/gi/components/CompareScroller.jsx on lines 60..65
src/applications/yellow-ribbon/components/SearchResultsPage/index.js on lines 83..88
src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmCancelModal.jsx on lines 42..47
src/applications/check-in/components/ActionLink.jsx on lines 49..54

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

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