department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function currentOrPastDateRangeUI has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const currentOrPastDateRangeUI = (fromOptions, toOptions, errorMessage) => {
  let fromLabel = 'From date';
  let toLabel = 'To date';
  let fromCustomOptions = {};
  let toCustomOptions = {};

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

      render() {
        const { terms, topContent } = this.props;
        const enabled =
          this.props.isDataAvailable === true ||
          typeof this.props.isDataAvailable === 'undefined';

      Function deselectBasedOnValue has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        static deselectBasedOnValue(name, value, formData, properties) {
          // derive the notListedTextKey by looking at the form schema properties for a 'string' field type
          // be aware this logic limits the usage to a single text field for a 'write in' style field
          const notListedTextKey = Object.entries(properties).reduce(
            (previous, [propertyKey, { type }]) => {

        Function OtherTextField has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function OtherTextField(props) {
          let { inputType } = props.options;
          if (!inputType) {
            inputType = numberTypes.has(props.schema.type) ? 'number' : props.type;
          }
        Severity: Minor
        Found in src/platform/user/profile/vap-svc/components/OtherTextField.jsx - About 1 hr to fix

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

            render() {
              const { form } = this.props;
              const { formId, data } = form;
          
              const { fullName } = data;

            Function ContestableIssuesWidget has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ContestableIssuesWidget = props => {
              const {
                getContestableIssues,
                contestableIssues,
                setFormData,

              Function formatServiceName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const formatServiceName = service => {
                if (!service) return null;
                const lowerCaseService = service
                  .replace(/([A-Z])/g, ' $1')
                  .replace(/\s+/g, ' ')
              Severity: Minor
              Found in src/applications/facility-locator/utils/formatServiceName.js - About 1 hr to fix

                Function submitForm has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const submitForm = (form, formConfig) => {
                  const body = formConfig.transformForSubmit
                    ? formConfig.transformForSubmit(formConfig, form)
                    : transformForSubmit(formConfig, form);
                  const benefits = form.data['view:benefit'];
                Severity: Minor
                Found in src/applications/edu-benefits/10203/submitForm.js - About 1 hr to fix

                  Function strongCaseTips has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const strongCaseTips = () => {
                      if (specReason) {
                        return (
                          <div>
                            <span>
                  Severity: Minor
                  Found in src/applications/discharge-wizard/components/gpSteps/StepOne.jsx - About 1 hr to fix

                    Function StatementOfTruth has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function StatementOfTruth(signatureProps) {
                      const pp = (
                        <span>
                          I have read and accept the{' '}
                          <va-link external href="/privacy-policy/" text="privacy policy" />
                    Severity: Minor
                    Found in src/applications/edu-benefits/10282/components/StatementOfTruth.jsx - About 1 hr to fix

                      Function activateInjectedAssets has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function activateInjectedAssets() {
                        fetch(`${getContentHostName()}/generated/headerFooter.json`)
                          .then(resp => {
                            if (resp.ok) {
                              return resp.json();
                      Severity: Minor
                      Found in src/applications/proxy-rewrite/proxy-rewrite-entry.jsx - About 1 hr to fix

                        Function getDateRangesBetween has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const getDateRangesBetween = (date1, date2) => {
                          const [year1, month1] = date1.split('-').map(str => parseInt(str, 10));
                          const [year2, month2] = date2.split('-').map(str => parseInt(str, 10));
                        
                          const ranges = [];
                        Severity: Minor
                        Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                          Function getEmptyState has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            getEmptyState(props) {
                              const {
                                onEdit,
                                hideTitle,
                                title,

                            Function FormTabBase has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const FormTabBase = props => {
                              const formInfo = getFormInfo(props.router);
                              const specialPages = formInfo?.pageList?.filter(
                                page =>
                                  page.path?.includes('/introduction') ||

                              Function bankInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const bankInfo = (state = initialState, action) => {
                                switch (action.type) {
                                  case UPDATE_BANK_INFO:
                                    return {
                                      ...state,
                              Severity: Minor
                              Found in src/applications/verify-your-enrollment/reducers/bankInfo.js - About 1 hr to fix

                                Function TrainingAndWebinar has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const TrainingAndWebinar = () => {
                                  return (
                                    <MainContentSubDiv
                                      id="trainings-and-webinars"
                                      header="Trainings and webinars"

                                  Function getRepresentativeStatus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    static getRepresentativeStatus() {
                                      const requestUrl = `${
                                        environment.API_URL
                                      }/representation_management/v0/power_of_attorney`;
                                      const apiSettings = {

                                    Function onSearch has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const onSearch = (event, filterList, dropdownValue) => {
                                        const incomingValue = event?.target?.filterBy?.value || dropdownValue;
                                    
                                        const newSelectedOption = filterByOptions.find(
                                          option => option?.value === incomingValue,
                                    Severity: Minor
                                    Found in src/applications/static-pages/events/components/Events/index.js - About 1 hr to fix

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

                                        render() {
                                          const { lat, long, address } = this.state;
                                          const { multiError, multiLoading, facilityID } = this.props;
                                          const loading = multiLoading ? multiLoading[facilityID] : false;
                                          const error = multiError ? multiError[facilityID] : false;

                                        Function LoadingPage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const LoadingPage = props => {
                                          const { router } = props;
                                          const { t } = useTranslation();
                                        
                                          const { goToNextPage } = useFormRouting(router);
                                        Severity: Minor
                                        Found in src/applications/check-in/travel-claim/pages/LoadingPage/index.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language