department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,732 of 12,811 total issues

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

const generateFeatureToggles = (toggles = {}) => {
  const {
    mhvLandingPagePersonalization = true,
    mhvMedicationsToVaGovRelease = true,
    mhvMedicationsDisplayRefillContent = true,
Severity: Minor
Found in src/applications/mhv-medications/mocks/api/feature-toggles/index.js - About 1 hr to fix

    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 =
          addressObject.countryName &&
    Severity: Critical
    Found in src/platform/forms-system/src/js/utilities/data/profile.js - About 1 hr to fix

      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 =
            addressObject.countryName &&

        Consider simplifying this complex logical expression.
        Open

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

          Consider simplifying this complex logical expression.
          Open

                if (address) {
                  const { militaryAddress } = address;
                  newData.address = {
                    street: address.street || '',
                    unitNumber: address.unitNumber || '',
          Severity: Critical
          Found in src/applications/representative-appoint/prefill-transformer.js - 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 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 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 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 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 vaRadioFieldMapping has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

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

                                  const mainTransform = formData => {
                                    const informalConference = showNewHlrContent(formData)
                                      ? formData.informalConferenceChoice === 'yes'
                                      : ['me', 'rep'].includes(formData.informalConference);
                                    const attributes = {
                                Severity: Minor
                                Found in src/applications/appeals/996/config/submit-transformer.js - 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 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 FinancialStatusWarning has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const FinancialStatusWarning = () => {
                                        const THIS_YEAR = LAST_YEAR + 1;
                                        const NEXT_YEAR = THIS_YEAR + 1;
                                        return (
                                          <va-alert

                                        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