department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,760 of 12,760 total issues

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

    VICV2: (
      <p>
        We’re sorry. We can’t confirm your eligibility for a Veteran ID card
        right now. To qualify for a Veteran ID Card, both of these must be true:
        <ul>
Severity: Major
Found in src/applications/veteran-id-card/config.jsx and 1 other location - About 1 hr to fix
src/applications/veteran-id-card/config.jsx on lines 67..82

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

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 default function ApplicantDescription({ formContext }) {
  return (
    <div>
      <p>
        You aren’t required to fill in all fields, but we can review your
src/platform/forms/components/ApplicantDescription.jsx on lines 4..14

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

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 (data.results.preface) {
    const prefaceOptions = { paragraphGap: 12, x: 20 };
    results.add(
      createSubHeading(doc, config, data.results.preface, prefaceOptions),
    );
Severity: Major
Found in src/platform/pdf/templates/medical_records.js and 1 other location - About 1 hr to fix
src/platform/pdf/templates/blue_button_report.js on lines 368..376

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

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

        onChange={e => {
          recordEvent({
            event: 'gibct-form-change',
            'gibct-form-field': 'Cumulative Post-9/11 active-duty service',
            'gibct-form-value': e.target.value,
Severity: Major
Found in src/applications/gi/components/SearchBenefits.jsx and 1 other location - About 1 hr to fix
src/applications/gi/containers/search/LocationSearchForm.jsx on lines 292..299

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

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 onCancleButtonClicked = () => {
    if (
      (hasAddressFormChanged(formData) && !goBackToEdit) ||
      (goBackToEdit && compareAddressObjects(editFormData, beforeDditFormData))
    ) {
src/applications/personalization/profile/components/direct-deposit/vye/containers/ChangeOfAddressWrapper.jsx on lines 193..202

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

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

  'GET /vaos/v0/community_care/eligibility/:id': (req, res) => {
    return res.json({
      data: {
        id: req.param.id,
        type: 'cc_eligibility',
Severity: Major
Found in src/applications/vaos/services/mocks/index.js and 1 other location - About 1 hr to fix
src/applications/vaos/services/mocks/index.js on lines 372..380

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

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 onCancleButtonClicked = () => {
    if (
      (hasAddressFormChanged(formData) && !goBackToEdit) ||
      (goBackToEdit && compareAddressObjects(editFormData, beforeDditFormData))
    ) {
src/applications/verify-your-enrollment/containers/ChangeOfAddressWrapper.jsx on lines 211..220

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

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 default function ApplicantDescription({ formContext }) {
  return (
    <div>
      <p>
        You aren’t required to fill in all fields, but we can review your
Severity: Major
Found in src/platform/forms/components/ApplicantDescription.jsx and 1 other location - About 1 hr to fix
src/applications/edu-benefits/10203/content/ApplicantDescription.jsx on lines 4..14

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

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>
            <va-link
              href={contactInfo.url}
              aria-label="Edit call back time"
              text="Edit"
src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ReasonForAppointmentSection.jsx on lines 75..83

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

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

export function createServiceMap(maintenanceWindows = []) {
  const serviceMap = new Map();

  // Maintenance windows should be sorted in ascending order
  // so that when a single externalService has multiple upcoming
Severity: Minor
Found in src/platform/monitoring/DowntimeNotification/util/helpers.js - About 1 hr to fix

    Function generateTocItem has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const generateTocItem = (doc, parent, data, pageData) => {
      const leftMargin = 100;
      const pages =
        pageData.startPage === pageData.endPage
          ? `page ${pageData.startPage}`
    Severity: Minor
    Found in src/platform/pdf/templates/blue_button_report.js - About 1 hr to fix

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

        render() {
          const primaryButton = {
            action: this.handleClose,
            text: 'Finish applying',
          };
      Severity: Minor
      Found in src/platform/forms/save-in-progress/FormSignInModal.jsx - About 1 hr to fix

        Function focusElement has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function focusElement(selectorOrElement, options = {}, root) {
          function applyFocus(el) {
            if (el) {
              // Use getAttribute to grab the "tabindex" attribute (returns string), not
              // the "tabIndex" property (returns number). Focusable elements will
        Severity: Minor
        Found in src/platform/utilities/ui/focus.js - About 1 hr to fix

          Function sortListByFuzzyMatch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function sortListByFuzzyMatch(value, list, prop = 'label') {
            return list
              .map(option => {
                const label = option[prop].toUpperCase().replace(/[^a-zA-Z ]/g, '');
                const val = value.toUpperCase().replace(/[^a-zA-Z ]/g, '');
          Severity: Minor
          Found in src/platform/utilities/fuzzy-matching.js - About 1 hr to fix

            Function vaDateCommonFieldMapping has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function vaDateCommonFieldMapping(props) {
              const {
                description,
                textDescription,
                DescriptionField,

              Function firstNameLastNameNoSuffixUI has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const firstNameLastNameNoSuffixUI = (formatTitle, uiOptions = {}) => {
                return {
                  'ui:validations': [validateEmpty],
                  first: {
                    'ui:title': formatTitle ? formatTitle('first name') : 'First name',

                Function updateUiSchema has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function updateUiSchema(schema, uiSchema, formData) {
                  if (!uiSchema) {
                    return uiSchema;
                  }
                
                
                Severity: Minor
                Found in src/platform/forms-system/src/js/state/helpers.js - About 1 hr to fix

                  Function sortListByFuzzyMatch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function sortListByFuzzyMatch(value, list, prop = 'label') {
                    return list
                      .map(option => {
                        const label = option[prop].toUpperCase().replace(/[^a-zA-Z ]/g, '');
                        const val = value.toUpperCase().replace(/[^a-zA-Z ]/g, '');
                  Severity: Minor
                  Found in src/platform/forms-system/src/js/utilities/fuzzy-matching.js - About 1 hr to fix

                    Function handleAdd has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      handleAdd() {
                        const numberOfItems = this.props.formData.length;
                        const lastIndex = numberOfItems - 1;
                    
                        if (errorSchemaIsValid(this.props.errorSchema[lastIndex])) {
                    Severity: Minor
                    Found in src/platform/forms-system/src/js/fields/ArrayField.jsx - About 1 hr to fix

                      Function Pending has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function Pending(props) {
                        const { formConfig, onBack, onSubmit } = props;
                        let ariaDescribedBy = null;
                        // If no ariaDescribedBy is passed down from form.js,
                        // a null value will properly not render the aria label.
                      Severity: Minor
                      Found in src/platform/forms-system/src/js/review/submit-states/Pending.jsx - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language