department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

  render() {
    return (
      <div
        className={`hidden-header vads-u-display--flex vads-u-align-items--center${
          this.props.isHeaderV2 ? '' : ' vads-u-padding-top--1'
Severity: Minor
Found in src/platform/site-wide/user-nav/components/SearchHelpSignIn.jsx - About 1 hr to fix

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

      render() {
        const buttonClasses = classNames(
          this.props.cssClass,
          { 'va-btn-withicon': this.props.icon },
          'va-dropdown-trigger',

      Function constructor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(props) {
          super(props);
      
          // Throw an error if there’s no viewComponent (should be React component)
          if (
      Severity: Minor
      Found in src/platform/forms-system/src/js/components/ReviewCardField.jsx - About 1 hr to fix

        Function replaceSchema has 34 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 fetchTotalDisabilityRating has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function fetchTotalDisabilityRating() {
            const {
              FETCH_TOTAL_RATING_STARTED,
              FETCH_TOTAL_RATING_FAILED,
              FETCH_TOTAL_RATING_SUCCEEDED,
          Severity: Minor
          Found in src/platform/user/profile/actions/hca.js - About 1 hr to fix

            Function mapStateToProps has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const mapStateToProps = (state, ownProps) => {
              const supplies = state.form?.data?.supplies;
              const batterySupplies = supplies
                ?.filter(battery => battery.productGroup?.includes('Battery'))
                .filter(battery => moment().diff(battery.nextAvailabilityDate) >= 0);

              Function profileInformation has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function profileInformation(state = initialState, action) {
                switch (action.type) {
                  case UPDATE_PROFILE_FIELDS: {
                    const newState = mapRawUserDataToState(action.payload);
                    return {
              Severity: Minor
              Found in src/platform/user/profile/reducers/index.js - About 1 hr to fix

                Function onSuccess has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const onSuccess = resp => {
                    const successfulSubmissions = resp.filter(response =>
                      response.status.toLowerCase().includes('processed'),
                    );
                    const failedSubmissions = resp.filter(
                Severity: Minor
                Found in src/applications/health-care-supply-reordering/config/form.js - About 1 hr to fix

                  Function getContestableIssues has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const getContestableIssues = props => {
                    const benefitType = props?.benefitType || DEFAULT_BENEFIT_TYPE;
                    const newApi = props?.[NEW_API];
                    return dispatch => {
                      dispatch({ type: FETCH_CONTESTABLE_ISSUES_INIT });
                  Severity: Minor
                  Found in src/applications/appeals/996/actions/index.js - About 1 hr to fix

                    Function mainTransform has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const mainTransform = formData => {
                        const { informalConferenceChoice } = formData;
                        // v2 value may still be in the save-in-progress form data (informalConference)
                        const informalConference = ['yes', 'no'].includes(informalConferenceChoice)
                          ? informalConferenceChoice === 'yes'
                    Severity: Minor
                    Found in src/applications/appeals/996/config/submit-transformer.js - About 1 hr to fix

                      Function renderBuddyStatements has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const renderBuddyStatements = () => {
                          return (
                            <li>
                              <h3>
                                Buddy statements (also called a Statement in Support of Claim or VA

                        Function submit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function submit(form, formConfig) {
                          const headers = { 'Content-Type': 'application/json' };
                          const body = transform(formConfig, form);
                          const apiRequestOptions = {
                            method: 'POST',
                        Severity: Minor
                        Found in src/applications/edu-benefits/feedback-tool/helpers.js - About 1 hr to fix

                          Function data has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            data: (state = initialState, action) => {
                              switch (action.type) {
                                case MEB_FETCH_CLAIM_STATUS:
                                  return {
                                    ...state,
                          Severity: Minor
                          Found in src/applications/education-letters/reducers/index.js - About 1 hr to fix

                            Function applicantHasInsuranceSchema has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function applicantHasInsuranceSchema(isPrimary) {
                              const keyname = isPrimary ? 'applicantHasPrimary' : 'applicantHasSecondary';
                              return {
                                uiSchema: {
                                  ...titleUI(

                              Function applicantMedigapSchema has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function applicantMedigapSchema(isPrimary) {
                                const keyname = isPrimary ? 'primaryMedigapPlan' : 'secondaryMedigapPlan';
                                return {
                                  uiSchema: {
                                    ...titleUI(

                                Function fileUploadUi has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const fileUploadUi = content => {
                                  // a11y focus management. Move focus to select after upload
                                  // see va.gov-team/issues/19688
                                  const addAnotherLabel = 'Upload another file';
                                
                                

                                  Function checkFlags has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function checkFlags(pages, person, newListOfMissingFiles) {
                                    const personUpdated = person; // shallow, updates reflect on actual form state
                                    const wrapped = Array.isArray(pages)
                                      ? pages
                                      : Object.keys(pages).map(pg => pages[pg]); // On confirmation, "pages" is obj

                                    Function BehalfOfSomeoneElseContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const BehalfOfSomeoneElseContent = () => {
                                      return (
                                        <>
                                          <p>
                                            You’ll need a copy of their sponsor’s DD214 or other separation papers.

                                      Function EnrollmentVerificationBreadcrumbs has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export default function EnrollmentVerificationBreadcrumbs() {
                                        const breadcrumbs = [
                                          { href: '/', label: 'Home' },
                                          { href: '/education/', label: 'Education and training' },
                                          {

                                        Function SignerContactInfoPage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function SignerContactInfoPage(props) {
                                          const updateButton = (
                                            // eslint-disable-next-line @department-of-veterans-affairs/prefer-button-component
                                            <button type="submit" onClick={props.updatePage}>
                                              Update page
                                        Severity: Minor
                                        Found in src/applications/ivc-champva/10-10D/pages/SignerContactInfoPage.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language