department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function formatReadableDate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const formatReadableDate = rawDate => {
  const months = [
    'January',
    'February',
    'March',
Severity: Minor
Found in src/applications/fry-dea/helpers.jsx - About 1 hr to fix

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

      render() {
        const pageDescription = (
          <>
            <h3 className="vads-u-font-size--h4">Shipping address</h3>
            <div className="vads-u-margin-top--2">

      Function LoginContainer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const LoginContainer = props => {
        const { externalApplication, isUnifiedSignIn, loggedOut } = props;
        // useDatadogRum();
      
        return (
      Severity: Minor
      Found in src/platform/user/authentication/components/LoginContainer.jsx - About 1 hr to fix

        Function useArticleData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function useArticleData() {
          const [articles, setArticles] = useState(null);
          const [errorMessage, setErrorMessage] = useState(null);
        
          useEffect(
        Severity: Minor
        Found in src/applications/resources-and-support/hooks/useArticleData.js - About 1 hr to fix

          Function updateSchema has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      updateSchema: (formData, schema, uiSchema) => {
                        const countryUI = uiSchema;
                        const addressFormData = get(
                          ['view:mailingAddress', 'address'],
                          formData,

            Function buildMarker has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const buildMarker = (type, values) => {
              if (type === 'location') {
                const { loc, attrs } = values;
                const markerElement = document.createElement('span');
                markerElement.className = 'i-pin-card-map';
            Severity: Minor
            Found in src/applications/facility-locator/utils/helpers.jsx - About 1 hr to fix

              Function matchHelper has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const matchHelper = (term, hsdatum) => {
                const regexTerm = new RegExp(term, 'i');
                const returnMatcher = {
                  nameMatch: termMatcher(regexTerm, hsdatum, 0),
                  akaMatch: termMatcher(regexTerm, hsdatum, 1),
              Severity: Minor
              Found in src/applications/facility-locator/hooks/useServiceType.jsx - About 1 hr to fix

                Function transform has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function transform(formConfig, form) {
                  // https://dev-developer.va.gov/explore/appeals/docs/decision_reviews?version=current
                  // https://github.com/department-of-veterans-affairs/vets-api/blob/master/modules/appeals_api/config/schemas/10182.json
                  const mainTransform = formData => {
                    const result = {
                Severity: Minor
                Found in src/applications/appeals/10182/config/submit-transformer.js - About 1 hr to fix

                  Function getRep has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const getRep = formData => {
                    if (formData.informalConference !== 'rep') {
                      return null;
                    }
                    const phoneNumber = (formData?.informalConferenceRep?.phone || '').replace(
                  Severity: Minor
                  Found in src/applications/appeals/996/utils/submit.js - About 1 hr to fix

                    Function formatServiceType has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const formatServiceType = rawServiceType => {
                        if (facilityType === LocationType.URGENT_CARE) {
                          if (!rawServiceType) {
                            return urgentCareServices.AllUrgentCare;
                          }

                      Function getForm4142 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const getForm4142 = formData => {
                        const facilities = getPrivateEvidence(formData);
                        if (facilities.length === 0) {
                          return null;
                        }
                      Severity: Minor
                      Found in src/applications/appeals/995/utils/submit.js - About 1 hr to fix

                        Function getForm4142 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const getForm4142 = formData => {
                          const {
                            evidencePrivacyAgreementAccepted = true,
                            limitedConsent = '',
                          } = formData;
                        Severity: Minor
                        Found in src/applications/appeals/testing/sc/utils/submit.js - About 1 hr to fix

                          Function CreateAccount has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function CreateAccount() {
                            const cspInfo = ['logingov', 'idme'];
                            return (
                              <div
                                className="vads-u-display--flex vads-u-flex-direction--column"
                          Severity: Minor
                          Found in src/applications/sign-in-changes/components/CreateAccount.jsx - About 1 hr to fix

                            Function Table has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function Table() {
                              return (
                                <div className="custom-table">
                                  <table className="usa-table" role="presentation">
                                    <tbody>
                            Severity: Minor
                            Found in src/applications/edu-benefits/feedback-tool/components/Table.jsx - About 1 hr to fix

                              Function applicantInformation has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                applicantInformation: formData => {
                                  if (_.isEmpty(_.get(formData, 'applicantFullName.first', {}))) {
                                    recordEvent({
                                      event: 'edu-0994--response-missing',
                                      'missing-field-question':
                              Severity: Minor
                              Found in src/applications/edu-benefits/0994/analytics-functions.js - About 1 hr to fix

                                Function createMutationObserverCallback has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function createMutationObserverCallback() {
                                  // Find native header, footer, etc based on page path
                                  const DEPRECATED_SELECTOR_CONFIG = [
                                    {
                                      path: /.*/,
                                Severity: Minor
                                Found in src/applications/proxy-rewrite/proxy-rewrite-entry.jsx - About 1 hr to fix

                                  Function fetchClaimantId has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const fetchClaimantId = () => {
                                    return async dispatch => {
                                      dispatch({ type: CHECK_CLAIMANT_START });
                                      const timeoutPromise = new Promise((_, reject) =>
                                        setTimeout(() => reject(new Error('Request timed out')), 5000),
                                  Severity: Minor
                                  Found in src/applications/verify-your-enrollment/actions/index.js - About 1 hr to fix

                                    Function getSelectOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function getSelectOptions() {
                                        const allAddresses = [];
                                        if (data.certifierAddress?.street && data.certifierName)
                                          allAddresses.push({
                                            originatorName: fullName(data.certifierName),

                                      Function processElement has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          const processElement = (el, path) => {
                                            // Check if element is a heading
                                            if (el?.matches?.('h1, h2, h3, h4, h5, h6')) {
                                              headings.push({
                                                text: el.textContent.trim(),

                                        Function claimantIdReducer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const claimantIdReducer = (state = initialState, action) => {
                                          switch (action.type) {
                                            case CHECK_CLAIMANT_START:
                                              return {
                                                ...state,
                                        Severity: Minor
                                        Found in src/applications/verify-your-enrollment/reducers/checkClaimant.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language