department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,846 of 12,846 total issues

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

export const schema = {
  type: 'object',
  properties: {
    toxicExposure: {
      type: 'object',
src/applications/disability-benefits/all-claims/pages/toxicExposure/gulfWar1990Locations.js on lines 31..41

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

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

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

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

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

Refactorings

Further Reading

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

export const applicantNameDobSchema = {
  uiSchema: {
    ...titleUI('Beneficiary’s name'),
    applicantName: fullNameMiddleInitialUI,
  },
src/applications/ivc-champva/10-7959a/chapters/signerInformation.js on lines 41..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

    primaryContactInfo: {
      name: {
        first: transformedData.veteranFullName?.first,
        last: transformedData.veteranFullName?.last,
      },
src/applications/ivc-champva/10-7959f-1/config/submitTransformer.js on lines 50..57

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

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 closeModal = e => {
      if (isEscape(e)) {
        overlay.classList.remove('vcl-overlay--open');
        document.body.classList.remove('va-pos-fixed');
        focusElement(openControl);
src/platform/site-wide/accessible-VCL-modal.js on lines 35..41

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

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

    <p data-testid="non-cerner-content">
      <strong>Note:</strong> If you can’t keep an existing appointment, please
      contact the facility as soon as you can to reschedule or cancel.
      <br />
      <a href="/find-locations/">Find your health facility’s phone number</a>
src/applications/static-pages/health-care-manage-benefits/schedule-view-va-appointments-page/components/AuthContent/index.js on lines 43..48

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

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

    if (/date|dob/.test(key.toLowerCase())) {
      const date = copy[key];
      copy[key] = `${date.slice(5)}-${date.slice(0, 4)}`;
    }
Severity: Major
Found in src/applications/ivc-champva/shared/utilities.js and 1 other location - About 1 hr to fix
src/applications/ivc-champva/10-7959C/config/submitTransformer.js on lines 43..46

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

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

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

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

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

Refactorings

Further Reading

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

export function selectModalityAriaText(appointment) {
  const modalityText = selectModalityText(appointment);
  const isCanceled = selectIsCanceled(appointment);
  return `${isCanceled ? 'canceled ' : ''}${modalityText} appointment`;
}
Severity: Major
Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 1 hr to fix
src/applications/vaos/appointment-list/redux/selectors.js on lines 609..613

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

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 onSearch has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const onSearch = componentState => {
  const savedSuggestions = componentState?.savedSuggestions || [];
  const suggestions = componentState?.suggestions || [];
  const searchTerm = componentState?.inputValue;
  const validSuggestions =
Severity: Minor
Found in src/platform/site-wide/header/helpers/index.js - About 1 hr to fix

    Function onSuggestionSubmit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const onSuggestionSubmit = (index, componentState) => {
        const savedSuggestions = componentState?.savedSuggestions || [];
        const suggestions = componentState?.suggestions || [];
        const inputValue = componentState?.inputValue;
    
    
    Severity: Minor
    Found in src/platform/site-wide/header/components/Search/index.js - About 1 hr to fix

      Function onSuggestionSubmit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const onSuggestionSubmit = (index, componentState) => {
        const savedSuggestions = componentState?.savedSuggestions || [];
        const suggestions = componentState?.suggestions || [];
        const searchTerm = componentState?.inputValue;
      
      
      Severity: Minor
      Found in src/platform/site-wide/header/helpers/index.js - About 1 hr to fix

        Function onInputSubmit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const onInputSubmit = componentState => {
            const savedSuggestions = componentState?.savedSuggestions || [];
            const suggestions = componentState?.suggestions || [];
            const inputValue = componentState?.inputValue;
            const validSuggestions =
        Severity: Minor
        Found in src/platform/site-wide/header/components/Search/index.js - About 1 hr to fix

          Function addNewArrayItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const addNewArrayItem = $form => {
            // Get all array types on the current page.
            const arrayTypeRoots = $form.find('div[name^="topOfTable_root_"]');
          
            // Find the last entry for each array type, use its index to figure out
          Severity: Minor
          Found in src/platform/testing/e2e/cypress/support/form-tester/index.js - About 1 hr to fix

            Function AutoSSO has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function AutoSSO(props) {
              const {
                authenticatedWithOAuth,
                hasCalledKeepAlive,
                transactionId,
            Severity: Minor
            Found in src/platform/site-wide/user-nav/containers/AutoSSO.jsx - About 1 hr to fix

              Function overrideAnimations has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function overrideAnimations(client) {
                const styles = `* {
                   -o-transition-property: none !important;
                   -moz-transition-property: none !important;
                   -ms-transition-property: none !important;
              Severity: Minor
              Found in src/platform/testing/e2e-puppeteer/helpers.js - About 1 hr to fix

                Function formatDowntime has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const formatDowntime = dateTime => {
                  let date;
                  const timeZone = 'America/New_York';
                
                  if (dateTime instanceof Object) {
                Severity: Minor
                Found in src/platform/utilities/date/index.js - About 1 hr to fix

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

                          replaceSchema: (formData, schema, _uiSchema, index, path) => {
                            if (schema.maxLength) {
                              cityMaxLength = schema.maxLength;
                            }
                            const addressPath = getAddressPath(path); // path is ['address', 'currentField']

                    Function updateFormDataAddress has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const updateFormDataAddress = (
                      oldFormData,
                      formData,
                      path,
                      index = null, // this is included in the path, but added as

                      Function updateFormDataAddress has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const updateFormDataAddress = (
                        oldFormData,
                        formData,
                        path,
                        index = null, // this is included in the path, but added as
                      Severity: Minor
                      Found in src/platform/forms-system/src/js/definitions/profileAddress.js - About 1 hr to fix

                        Function createStringifyFormReplacer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function createStringifyFormReplacer(options) {
                          const replacerFn = (key, value) => {
                            if (!options?.allowPartialAddress && isPartialAddress(value)) {
                              return undefined;
                            }
                        Severity: Minor
                        Found in src/platform/forms-system/src/js/helpers.js - About 1 hr to fix

                          Function pageAndDataState has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              (state, page) => {
                                const definitions = {
                                  ...(formConfig.defaultDefinitions || {}),
                                  ...page.schema.definitions,
                                };
                          Severity: Minor
                          Found in src/platform/forms-system/src/js/state/helpers.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language