department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,844 of 12,844 total issues

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

const BenefitsForm = ({
  children,
  cumulativeService,
  eligForPostGiBill,
  eligibilityChange,
Severity: Major
Found in src/applications/gi/components/profile/BenefitsForm.jsx and 1 other location - About 1 hr to fix
src/applications/ivc-champva/shared/components/applicantLists/ApplicantAddressPage.jsx on lines 9..221

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  try {
    const { errors, debts } = await getDebts();
    if (errors) {
      recordEvent({
        event: `api_call`,
Severity: Major
Found in src/applications/personalization/dashboard/actions/debts.js and 1 other location - About 1 hr to fix
src/applications/personalization/dashboard/actions/debts.js on lines 103..146

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  try {
    const { data, errors } = await getCopays();
    if (errors) {
      recordEvent({
        event: `api_call`,
Severity: Major
Found in src/applications/personalization/dashboard/actions/debts.js and 1 other location - About 1 hr to fix
src/applications/personalization/dashboard/actions/debts.js on lines 40..85

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

const summaryPage = {
  uiSchema: {
    'view:isAddingVAMedicalCenters': arrayBuilderYesNoUI(options, {
      title: 'Have you received treatment from a VA medical center?',
      labelHeaderLevel: ' ',
src/applications/pensions/config/chapters/04-household-information/dependentChildrenPages.js on lines 77..92

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

const requiredWarningHeading = (
  <>
    <VaAlert uswds status="warning">
      <h2>
        You’ve submitted your CHAMPVA benefits application without required
src/applications/ivc-champva/10-7959C/containers/ConfirmationPage.jsx on lines 33..44

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    const {
      componentClassName,
      containerClassName,
      buttonClassName,
      inputClassName,
src/applications/personalization/profile/components/direct-deposit/DirectDeposit.jsx on lines 54..69

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            <div className="vads-l-col--12 small-screen:vads-l-col--6 vads-u-margin--1">
              <VaTextInput
                name="v1Input"
                label="V1 Input"
                hint="This is a hint"
Severity: Major
Found in src/applications/ds-playground/pages/V1V3Page.jsx and 1 other location - About 1 hr to fix
src/applications/ds-playground/pages/V1V3Page.jsx on lines 340..348

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function getSubmenu has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getSubmenu(item, currentSection) {
    if (this.mobileMediaQuery?.matches) {
      const menuSections = [
        item.menuSections.mainColumn,
        item.menuSections.columnOne,
Severity: Minor
Found in src/platform/site-wide/mega-menu/components/MegaMenu.jsx - About 1 hr to fix

    Function replaceSchema has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            replaceSchema: (formData, _schema, _uiSchema, index, path) => {
              const addressPath = getAddressPath(path); // path is ['address', 'currentField']
              cachedPath = addressPath;
              const data = get(addressPath, formData) ?? {};
              const { country } = data;

      Function createRoutes has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function createRoutes(formConfig) {
        // Validate the config while creating the routes because this is really the
        // entry point for applications to use the forms library.
        // TODO: Tree shake this config validation in prod
        validateConfig(formConfig);
      Severity: Minor
      Found in src/platform/forms-system/src/js/routing.js - About 1 hr to fix

        Function pactAct has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const pactAct = (state = initialState, action) => {
          switch (action.type) {
            case PAW_UPDATE_SERVICE_PERIOD:
              return updateFormValue(SERVICE_PERIOD, false, state, action);
            case PAW_UPDATE_BURN_PIT_2_1:
        Severity: Minor
        Found in src/applications/pact-act/reducers/index.js - About 1 hr to fix

          Function fetchFormStatus has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const fetchFormStatus = () => async dispatch => {
            dispatch(initiateApiCall());
            const sessionExpiration = localStorage.getItem('sessionExpiration');
            const remainingSessionTime = moment(sessionExpiration).diff(moment());
            if (!remainingSessionTime) {
          Severity: Minor
          Found in src/applications/health-care-supply-reordering/actions/index.js - About 1 hr to fix

            Function prefillTransformer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function prefillTransformer(pages, formData, metadata, state) {
              const vaProfile = state.user.profile;
            
              // For reference, I _think_ the vapContactInfo has the follow form:
              // const vapContactInfo = {
            Severity: Minor
            Found in src/applications/fry-dea/helpers.jsx - About 1 hr to fix

              Function DecisionReviewPage has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const DecisionReviewPage = () => {
                useEffect(() => {
                  setTimeout(() => {
                    focusElement('#main h2');
                  });
              Severity: Minor
              Found in src/applications/appeals/996/subtask/pages/other.jsx - About 1 hr to fix

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

                  render() {
                    return (
                      <div>
                        <va-button onClick={this.openModal} text="Opt Out" />
                        <VaModal
                Severity: Minor
                Found in src/applications/edu-benefits/components/OptOutWizard.jsx - About 1 hr to fix

                  Function mailInfo has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const mailInfo = (address, officeName, faxNum, preamble, appType) => {
                    const faxNumMarkup = (
                      <VaTelephone
                        contact={JSON.stringify({
                          phoneNumber: faxNum ?? '3033317809',

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

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

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

                        render() {
                          const { form } = this.props;
                          const { submission, formId, data } = form;
                      
                          const { fullName } = data;

                        Function MFA has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const MFA = () => {
                          const verifyLink = useCallback(async policy => {
                            await verify({ policy, isLink: true, isSignup: false });
                          }, []);
                        
                        

                          Function verifyDependents has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function verifyDependents(state = initialState, action) {
                            switch (action.type) {
                              case DEPENDENCY_VERIFICATION_CALL_SUCCESS:
                                return {
                                  ...state,
                            Severity
                            Category
                            Status
                            Source
                            Language