department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,759 of 12,759 total issues

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

  render() {
    const enrollmentData = this.props.enrollmentData || {};

    const todayFormatted = formatDateLong(new Date());

Severity: Minor
Found in src/applications/post-911-gib-status/containers/PrintPage.jsx - About 1 hr to fix

    Function viewportPresetHelper has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const viewportPresetHelper = (preset, orientation, options) => {
      if (
        isValidPreset(preset) &&
        isValidOrientation(orientation) &&
        isValidOptions(options)
    Severity: Minor
    Found in src/platform/testing/e2e/cypress/support/commands/viewportPreset.js - About 1 hr to fix

      Function bodyObserver has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const bodyObserver = new MutationObserver(bodyMutationsList => {
          bodyMutationsList.forEach(bodyMutation => {
            if (bodyMutation.addedNodes.length > 0) {
              bodyMutation.addedNodes.forEach(bodyNode => {
                if (bodyNode.id === 'kampyleButtonContainer') {
      Severity: Minor
      Found in src/platform/site-wide/medallia-feedback-button.js - About 1 hr to fix

        Function createImageDetailItem has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const createImageDetailItem = async (doc, config, x, item) => {
          let titleText = item.title ?? '';
          const content = [];
        
          if (titleText) {
        Severity: Minor
        Found in src/platform/pdf/templates/utils.js - About 1 hr to fix

          Function newDraft has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const newDraft = (req, res) => {
            const { body, category, recipientId, subject } = req.body;
            return res.json({
              data: {
                id: '3885180',
          Severity: Minor
          Found in src/platform/mhv/api/mocks/secure-messaging/drafts/index.js - About 1 hr to fix

            Function saveReply has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const saveReply = (req, res) => {
              const { body, category, recipientId, subject } = req.body;
              return res.json({
                data: {
                  id: '3885180',
            Severity: Minor
            Found in src/platform/mhv/api/mocks/secure-messaging/drafts/index.js - About 1 hr to fix

              Function generateHelpSection has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const generateHelpSection = (doc, parent) => {
                const infoSection = doc.struct('Sect', {
                  title: 'Information',
                });
                infoSection.add(
              Severity: Minor
              Found in src/platform/pdf/templates/blue_button_report.js - About 1 hr to fix

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

                  getEmptyState(props) {
                    const {
                      onEdit,
                      hideTitle,
                      title,
                Severity: Minor
                Found in src/platform/forms-system/src/js/components/SchemaForm.jsx - About 1 hr to fix

                  Function baseSet has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function baseSet(arrayPath, value, object, level = 0) {
                    if (level >= arrayPath.length) {
                      // We're at the end of our path; time to assign
                      return value;
                    }
                  Severity: Minor
                  Found in src/platform/utilities/data/set.js - About 1 hr to fix

                    Function VaSelectField has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function VaSelectField(props) {
                      let addDefaultEntry = false;
                      const mappedProps = vaSelectFieldMapping(props);
                      const enumOptions =
                        (Array.isArray(props.childrenProps.schema.enum) &&

                      Function vaCheckboxFieldMapping has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function SSNWidget has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function SSNWidget(props) {
                          const [val, setVal] = useState(props.value);
                          const [displayVal, setDisplayVal] = useState(props.value);
                        
                          const handleChange = value => {
                        Severity: Minor
                        Found in src/platform/forms-system/src/js/widgets/VAFileNumberWidget.jsx - About 1 hr to fix

                          Function accessibleFieldContent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  {this.orderedProperties.map((objectFields, index) => {
                                    if (objectFields.length > 1) {
                                      const [first, ...rest] = objectFields;
                                      const visible = rest.filter(
                                        prop => !schema.properties[prop]['ui:collapsed'],
                          Severity: Minor
                          Found in src/platform/forms-system/src/js/fields/ObjectField.jsx - About 1 hr to fix

                            Function Submitted has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function Submitted(props) {
                              const { formConfig, onBack, onSubmit } = props;
                              let ariaDescribedBy = null;
                              // If no ariaDescribedBy is passed down from form.js,
                              // a null value will properly not render the aria label.
                            Severity: Minor
                            Found in src/platform/forms-system/src/js/review/submit-states/Submitted.jsx - About 1 hr to fix

                              Function baseSet has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function baseSet(arrayPath, value, object, level = 0) {
                                if (level >= arrayPath.length) {
                                  // We're at the end of our path; time to assign
                                  return value;
                                }
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/utilities/data/set.js - About 1 hr to fix

                                Function validatePages has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function validatePages(orderedPageTypes) {
                                  const pageTypes = {};
                                  for (const pageType of orderedPageTypes) {
                                    if (pageType === 'intro') {
                                      if (pageTypes.intro || pageTypes.summary || pageTypes.item) {

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

                                  export const formatReadableDate = (rawDate, minimumDateDigits = 1) => {
                                    const months = [
                                      'January',
                                      'February',
                                      'March',
                                  Severity: Minor
                                  Found in src/applications/my-education-benefits/helpers.js - About 1 hr to fix

                                    Function recordPanEvent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const recordPanEvent = (mapCenter, currentQuery) => {
                                      const { searchCoords, searchArea } = currentQuery;
                                    
                                      return new Promise((resolve, _) => {
                                        let distanceMoved;
                                    Severity: Minor
                                    Found in src/applications/facility-locator/utils/analytics.js - About 1 hr to fix

                                      Function CustomPhoneNumberField has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function CustomPhoneNumberField(props) {
                                        function handleChange(event) {
                                          if (props?.showMebEnhancements08) {
                                            props?.updateGlobalPhoneNumber(event);
                                            if (event?.length > 9) {

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

                                        export function transform(formConfig, form) {
                                          // https://developer.va.gov/explore/appeals/docs/decision_reviews?version=current
                                          // match supplemental claims schema here
                                          const mainTransform = formData => {
                                            const { benefitType, additionalDocuments } = formData;
                                        Severity: Minor
                                        Found in src/applications/appeals/995/config/submit-transformer.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language