department-of-veterans-affairs/vets-website

View on GitHub
src/applications/edu-benefits/feedback-tool/helpers.js

Summary

Maintainability
C
1 day
Test Coverage

File helpers.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import appendQuery from 'append-query';
import * as Sentry from '@sentry/browser';
import React from 'react';
import fullSchema from 'vets-json-schema/dist/FEEDBACK-TOOL-schema.json';
import { transformForSubmit } from 'platform/forms-system/src/js/helpers';
Severity: Minor
Found in src/applications/edu-benefits/feedback-tool/helpers.js - About 3 hrs to fix

    Consider simplifying this complex logical expression.
    Open

      if (isDomesticAddress) {
        address = {
          country: 'United States',
          street:
            address1 &&
    Severity: Critical
    Found in src/applications/edu-benefits/feedback-tool/helpers.js - About 3 hrs to fix

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

      export function submit(form, formConfig) {
        const headers = { 'Content-Type': 'application/json' };
        const body = transform(formConfig, form);
        const apiRequestOptions = {
          method: 'POST',
      Severity: Minor
      Found in src/applications/edu-benefits/feedback-tool/helpers.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status