department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Consider simplifying this complex logical expression.
Open

  if (keys.address && requiredKeys.includes(keys.address)) {
    const addressObject = data[keys.address] || {};

    const isUS = addressObject.addressType !== ADDRESS_TYPES.international;
    const hasRequiredAddressFields =

    Consider simplifying this complex logical expression.
    Open

          if (type === 'manual') {
            setSavedDraft(true);
    
            if (validSignatureNotRequired) {
              setNavigationError(null);

      Consider simplifying this complex logical expression.
      Open

        if (
          errorCodes.some(
            code =>
              code === 10000 ||
              code === 10005 ||

        Consider simplifying this complex logical expression.
        Open

            if (radiologyDetails.studyId) {
              if (processingRequest) {
                return (
                  <va-loading-indicator
                    message="Loading..."

          Consider simplifying this complex logical expression.
          Open

              if (prescription || prescriptionsApiError) {
                return (
                  // TODO: clean after grouping flag is gone
                  <div
                    className={`${showGroupingContent ? 'vads-u-margin-bottom--4' : ''}`}
          Severity: Critical
          Found in src/applications/mhv-medications/containers/PrescriptionDetails.jsx - About 1 hr to fix

            Function render has 33 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 generateResultItemContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const generateResultItemContent = async (
                item,
                doc,
                results,
                hasHorizontalRule,
              Severity: Minor
              Found in src/platform/pdf/templates/blue_button_report.js - About 1 hr to fix

                Function generateFooterContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const generateFooterContent = async (
                  doc,
                  parent,
                  data,
                  config,
                Severity: Minor
                Found in src/platform/pdf/templates/utils.js - About 1 hr to fix

                  Function generateResultItemContent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const generateResultItemContent = async (
                    item,
                    doc,
                    results,
                    hasHorizontalRule,
                  Severity: Minor
                  Found in src/platform/pdf/templates/self_entered_info.js - About 1 hr to fix

                    Function checkAutoSession has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export async function checkAutoSession(
                      loggedIn,
                      ssoeTransactionId,
                      profile = {},
                    ) {
                    Severity: Minor
                    Found in src/platform/utilities/sso/index.js - About 1 hr to fix

                      Function VaRadioField has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function VaRadioField(props) {
                        const mappedProps = vaRadioFieldMapping(props);
                        const enumOptions =
                          Array.isArray(props.childrenProps.schema.enum) &&
                          optionsList(props.childrenProps.schema);

                        Function vaRadioFieldMapping has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function vaRadioFieldMapping(props) {
                          const {
                            description,
                            textDescription,
                            DescriptionField,

                          Function SsnField has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function SsnField(fieldProps) {
                            const props = vaTextInputFieldMapping(fieldProps);
                          
                            const [val, setVal] = useState(props.value);
                            const [displayVal, setDisplayVal] = useState(props.value);
                          Severity: Minor
                          Found in src/platform/forms-system/src/js/web-component-fields/SsnField.jsx - About 1 hr to fix

                            Function fileUiSchema has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function fileUiSchema(label, userOptions = {}) {
                              return {
                                'ui:title': label,
                                'ui:field': FileField,
                                'ui:options': {
                            Severity: Minor
                            Found in src/platform/forms-system/src/js/definitions/file.js - About 1 hr to fix

                              Function recalculateSchemaAndData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function recalculateSchemaAndData(initialState) {
                                return Object.keys(initialState.pages).reduce((state, pageKey) => {
                                  // on each data change, we need to do the following steps
                                  // Recalculate any required fields, based on the new data
                                  const page = state.pages[pageKey];
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/state/helpers.js - About 1 hr to fix

                                Function TextNotificationsDisclaimer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function TextNotificationsDisclaimer() {
                                  return (
                                    <>
                                      <h4>What to know about text notifications</h4>
                                      <ul>

                                  Function CustomEmailField has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function CustomEmailField(props) {
                                    function handleChange(event) {
                                      if (props?.showMebEnhancements08) {
                                        if (props.email !== event) {
                                          props.setFormData({

                                    Function onContinueClick has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const onContinueClick = async () => {
                                        const year = yearInput || new Date().getFullYear();
                                    
                                        if (dependentsInput && year && zipCodeInput) {
                                          setSubmitting(true);
                                    Severity: Minor
                                    Found in src/applications/income-limits/containers/ReviewPage.jsx - About 1 hr to fix

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

                                        const strongCaseTips = () => {
                                          if (specialReason) {
                                            const { name, type } = reasonsObj[reason];
                                            return (
                                              <>

                                        Function enrollmentStatus has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function enrollmentStatus(state = ENROLLMENT_STATUS_INIT_STATE, action) {
                                          const { response = {}, type } = action;
                                          const {
                                            FETCH_ENROLLMENT_STATUS_STARTED,
                                            FETCH_ENROLLMENT_STATUS_SUCCEEDED,
                                        Severity: Minor
                                        Found in src/applications/ezr/reducers/enrollment-status.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language