department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

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

    {
      id: 'c3e3e32701e23fdf389c06eae00fcb24',
      type: 'va_appointments',
      attributes: {
        startDate: formatISO(addDays(Date.now(), 35)),
src/applications/personalization/dashboard/utils/mocks/appointments/MOCK_VA_APPOINTMENTS.js on lines 5..120

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

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

    Zone.prototype = {
        _set : function (unpacked) {
            this.name       = unpacked.name;
            this.abbrs      = unpacked.abbrs;
            this.untils     = unpacked.untils;
Severity: Major
Found in src/applications/vaos/lib/moment-tz.js and 1 other location - About 2 days to fix
src/applications/personalization/dashboard/lib/moment-tz.js on lines 156..218

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

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

  Zone.prototype = {
    _set: function(unpacked) {
      this.name = unpacked.name;
      this.abbrs = unpacked.abbrs;
      this.untils = unpacked.untils;
Severity: Major
Found in src/applications/personalization/dashboard/lib/moment-tz.js and 1 other location - About 2 days to fix
src/applications/vaos/lib/moment-tz.js on lines 149..208

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

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

export function getStatusContents(appeal, name = {}) {
  const { status, aoj, programArea } = appeal.attributes;
  const appealType = appeal.type;
  const statusType = status.type || status;
  const details = status.details || {};
Severity: Major
Found in src/applications/personalization/dashboard/utils/getStatusContents.jsx - About 2 days to fix

    Function renderAdditionalInfo has 568 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const renderAdditionalInfo = (diaryCode, dateOfLetter, benefitType) => {
      const endDate = (date, days) =>
        moment(date, 'MM-DD-YYYY')
          .add(days, 'days')
          .format('MMMM Do, YYYY,');

      Function Prescriptions has 568 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Prescriptions = () => {
        const { search } = useLocation();
        const history = useHistory();
        const dispatch = useDispatch();
        const paginatedPrescriptionsList = useSelector(
      Severity: Major
      Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 2 days to fix

        File calculator.js has 1093 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { isEmpty } from 'lodash';
        import { createSelector } from 'reselect';
        import {
          formatCurrency,
          isCountryUSA,
        Severity: Major
        Found in src/applications/gi/selectors/calculator.js - About 2 days to fix

          File covidResearchUISchema.js has 1090 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import _ from 'lodash';
          
          import fullNameUI from 'platform/forms/definitions/fullName';
          import { validateBooleanGroup } from 'platform/forms-system/src/js/validation';

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

            export function transform(formConfig, form) {
              // Copy over sponsor data if the claimant is the veteran.
              const populateSponsorData = application =>
                isVeteran({ application })
                  ? merge({}, application, {
            Severity: Major
            Found in src/applications/pre-need/utils/helpers.js and 1 other location - About 2 days to fix
            src/applications/pre-need-integration/utils/helpers.js on lines 639..751

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

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

            export function transform(formConfig, form) {
              // Copy over sponsor data if the claimant is the veteran.
              const populateSponsorData = application =>
                isVeteran({ application })
                  ? merge({}, application, {
            Severity: Major
            Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 2 days to fix
            src/applications/pre-need/utils/helpers.js on lines 433..545

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

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

            const FileField = props => {
              const {
                enableShortWorkflow,
                errorSchema,
                formContext,
            Severity: Major
            Found in src/platform/forms-system/src/js/fields/FileField.jsx - About 2 days to fix

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

              const formConfig = {
                rootUrl: manifest.rootUrl,
                urlPrefix: '/',
                // submitUrl: '/v0/api',
                submit: () =>
              Severity: Major
              Found in src/applications/edu-benefits/10215/config/form.js and 4 other locations - About 2 days to fix
              src/applications/edu-benefits/10216/config/form.js on lines 32..138
              src/applications/edu-benefits/10282/config/form.js on lines 32..138
              src/applications/edu-benefits/1919/config/form.js on lines 32..138
              src/applications/edu-benefits/8794/config/form.js on lines 32..138

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

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

              const formConfig = {
                rootUrl: manifest.rootUrl,
                urlPrefix: '/',
                // submitUrl: '/v0/api',
                submit: () =>
              Severity: Major
              Found in src/applications/edu-benefits/1919/config/form.js and 4 other locations - About 2 days to fix
              src/applications/edu-benefits/10215/config/form.js on lines 32..138
              src/applications/edu-benefits/10216/config/form.js on lines 32..138
              src/applications/edu-benefits/10282/config/form.js on lines 32..138
              src/applications/edu-benefits/8794/config/form.js on lines 32..138

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

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

              const formConfig = {
                rootUrl: manifest.rootUrl,
                urlPrefix: '/',
                // submitUrl: '/v0/api',
                submit: () =>
              Severity: Major
              Found in src/applications/edu-benefits/8794/config/form.js and 4 other locations - About 2 days to fix
              src/applications/edu-benefits/10215/config/form.js on lines 32..138
              src/applications/edu-benefits/10216/config/form.js on lines 32..138
              src/applications/edu-benefits/10282/config/form.js on lines 32..138
              src/applications/edu-benefits/1919/config/form.js on lines 32..138

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

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

              const formConfig = {
                rootUrl: manifest.rootUrl,
                urlPrefix: '/',
                // submitUrl: '/v0/api',
                submit: () =>
              Severity: Major
              Found in src/applications/edu-benefits/10216/config/form.js and 4 other locations - About 2 days to fix
              src/applications/edu-benefits/10215/config/form.js on lines 32..138
              src/applications/edu-benefits/10282/config/form.js on lines 32..138
              src/applications/edu-benefits/1919/config/form.js on lines 32..138
              src/applications/edu-benefits/8794/config/form.js on lines 32..138

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

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

              const formConfig = {
                rootUrl: manifest.rootUrl,
                urlPrefix: '/',
                // submitUrl: '/v0/api',
                submit: () =>
              Severity: Major
              Found in src/applications/edu-benefits/10282/config/form.js and 4 other locations - About 2 days to fix
              src/applications/edu-benefits/10215/config/form.js on lines 32..138
              src/applications/edu-benefits/10216/config/form.js on lines 32..138
              src/applications/edu-benefits/1919/config/form.js on lines 32..138
              src/applications/edu-benefits/8794/config/form.js on lines 32..138

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

              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

              File moment-tz.js has 1071 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* istanbul ignore file */
              //! moment-timezone.js
              //! version : 0.5.25
              //! Copyright (c) JS Foundation and other contributors
              //! license : MIT
              Severity: Major
              Found in src/applications/vaos/lib/moment-tz.js - About 2 days to fix

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

                  const updateFormData = () => {
                    if (
                      !isValidFromDate(employmentRecord.from) ||
                      (!isValidToDate(employmentRecord.from, employmentRecord.to) &&
                        !employmentRecord.isCurrent)
                src/applications/financial-status-report/components/employment/EmploymentWorkDates.jsx on lines 53..125

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

                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 updateFormData = () => {
                    if (
                      !isValidFromDate(employmentRecord.from) ||
                      (!isValidToDate(employmentRecord.from, employmentRecord.to) &&
                        !employmentRecord.isCurrent)
                src/applications/financial-status-report/components/employment/SpouseEmploymentWorkDates.jsx on lines 53..128

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

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

                const FileField = props => {
                  const {
                    enableShortWorkflow,
                    errorSchema,
                    formContext,
                Severity: Major
                Found in src/applications/simple-forms/40-0247/components/FileField.jsx - About 2 days to fix
                  Severity
                  Category
                  Status
                  Source
                  Language