department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,835 of 12,835 total issues

Function vitalReducer has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const vitalReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.Vitals.GET: {
      return {
        ...state,
Severity: Major
Found in src/applications/mhv-medical-records/reducers/vitals.js - About 2 hrs to fix

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

      render() {
        const { enrollmentData } = this.props;
        let introText;
        let printButton;
        if (enrollmentData.veteranIsEligible) {
    Severity: Major
    Found in src/applications/post-911-gib-status/containers/StatusPage.jsx - About 2 hrs to fix

      File helpers.jsx has 260 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import { Link } from 'react-router';
      import moment from 'moment';
      
      import {
      Severity: Minor
      Found in src/applications/post-911-gib-status/utils/helpers.jsx - About 2 hrs to fix

        File EnhancedSpouseEmploymentRecord.jsx has 259 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useState } from 'react';
        import { connect } from 'react-redux';
        import PropTypes from 'prop-types';
        import { setData } from 'platform/forms-system/src/js/actions';
        import {

          Function initUserMock has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function initUserMock(token, level) {
            mock(token, {
              path: '/v0/user',
              verb: 'get',
              value: {
          Severity: Major
          Found in src/platform/testing/e2e-puppeteer/auth.js - About 2 hrs to fix

            Function ReviewFieldTemplate has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function ReviewFieldTemplate(props) {
              const { children, uiSchema, schema, formContext } = props;
              const label = uiSchema['ui:title'] || props.label;
              const description = uiSchema['ui:description'];
              const textDescription = typeof description === 'string' ? description : null;
            Severity: Major
            Found in src/platform/forms-system/src/js/review/ReviewFieldTemplate.jsx - About 2 hrs to fix

              Function checkValidSchema has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function checkValidSchema(schema, errors = [], path = ['root']) {
                if (typeof schema.type !== 'string') {
                  errors.push(`Missing type in ${path.join('.')} schema.`);
                }
              
              
              Severity: Major
              Found in src/platform/forms-system/src/js/helpers.js - About 2 hrs to fix

                Function fetchPersonalInformation has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function fetchPersonalInformation(
                  forceCacheClear = false,
                  recordAnalyticsEvent = recordEvent,
                ) {
                  return async dispatch => {
                Severity: Major
                Found in src/platform/user/profile/vap-svc/actions/personalInformation.js - About 2 hrs to fix

                  Function createAdditionalConsiderations has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function createAdditionalConsiderations(submissionForm) {
                    if (submissionForm?.mebExclusionPeriodEnabled) {
                      const exclusionPeriods = submissionForm.exclusionPeriods || [];
                      const mapping = {
                        academyRotcScholarship: {
                  Severity: Major
                  Found in src/applications/my-education-benefits/utils/form-submit-transform.js - About 2 hrs to fix

                    Function fetchLocations has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const fetchLocations = async (
                      address = null,
                      bounds,
                      locationType,
                      serviceType,
                    Severity: Major
                    Found in src/applications/facility-locator/actions/locations/fetchLocations.js - About 2 hrs to fix

                      Function BenefitRelinquishmentDate has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const BenefitRelinquishmentDate = props => {
                        const { formData, setFormData } = props;
                      
                        const aYearAgo = moment(new Date()).subtract(1, 'y');
                        const populateDate = () => {

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

                          render() {
                            if (this.state.loading) {
                              return <va-loading-indicator message="Loading facilities..." />;
                            }
                        
                        
                        Severity: Major
                        Found in src/applications/static-pages/facilities/OtherFacilityListWidget.jsx - About 2 hrs to fix

                          Function TravelEligibilityAddtionalInfo has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const TravelEligibilityAddtionalInfo = () => {
                            const boldComponent = [
                              <span key="bold" className="vads-u-font-weight--bold" />,
                            ];
                            return (

                            Function Waivers has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const Waivers = () => {
                              useEffect(() => {
                                recordEvent({
                                  event: 'howToWizard-alert-displayed',
                                  'reason-for-alert':
                            Severity: Major
                            Found in src/applications/financial-status-report/wizard/pages/Waivers.jsx - About 2 hrs to fix

                              Function getPastAppointmentDateRangeOptions has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function getPastAppointmentDateRangeOptions(today = moment()) {
                                const startOfToday = today.clone().startOf('day');
                              
                                // Past 3 months
                                const options = [

                                Function AccountUpdateView has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const AccountUpdateView = props => {
                                  // all props used come from the result of the useDirectDeposit hook
                                  const {
                                    formData,
                                    formSubmit,

                                  Function SearchReducer has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function SearchReducer(state = initialState, action) {
                                    switch (action.type) {
                                      case FETCH_SEARCH_RESULTS: {
                                        return {
                                          ...state,
                                  Severity: Major
                                  Found in src/applications/search/reducers/index.js - About 2 hrs to fix

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

                                          currentName: merge({}, fullNameUI, {
                                            first: {
                                              'ui:title': 'Sponsor’s first name',
                                            },
                                            last: {
                                    Severity: Major
                                    Found in src/applications/pre-need/config/pages/sponsorDetails.jsx and 1 other location - About 2 hrs to fix
                                    src/applications/pre-need-integration/config/pages/sponsorDetails.jsx on lines 27..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 79.

                                    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 const titleCase = str => {
                                      return str
                                        .toLowerCase()
                                        .split(' ')
                                        .map(word => word.charAt(0).toUpperCase() + word.slice(1))
                                    Severity: Major
                                    Found in src/applications/mhv-secure-messaging/util/helpers.js and 1 other location - About 2 hrs to fix
                                    src/applications/combined-debt-portal/combined/utils/helpers.js on lines 65..71

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

                                    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

                                        const options = INSTITUTION_TYPES.map(type => {
                                          return {
                                            name: type.toUpperCase(),
                                            checked: excludedSchoolTypes.includes(type.toUpperCase()),
                                            optionLabel: INSTITUTION_TYPES_DICTIONARY[type],
                                    src/applications/gi/containers/FilterYourResults.jsx on lines 260..267

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

                                    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