Showing 4,231 of 14,884 total issues
Function vaProfile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function vaProfile(state = initialState, action) {
switch (action.type) {
case FETCH_HERO_SUCCESS:
case FETCH_HERO_FAILED:
return set('hero', action.hero, state);
Function convertAccountSummary
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const convertAccountSummary = data => {
if (!data) return null;
// Extract necessary fields
const { facilities = [], ipas } = data;
Function SearchResultsHeader
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const SearchResultsHeader = props => {
const { query, resultCount, inProgress } = props;
const searchWasPerformed = !!query;
Function createServiceMap
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createServiceMap(maintenanceWindows = []) {
const serviceMap = new Map();
// Maintenance windows should be sorted in ascending order
// so that when a single externalService has multiple upcoming
Function firstNameLastNameNoSuffixUI
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const firstNameLastNameNoSuffixUI = (formatTitle, uiOptions = {}) => {
return {
'ui:validations': [validateEmpty],
first: {
'ui:title': formatTitle ? formatTitle('first name') : 'First name',
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const primaryButton = {
action: this.handleClose,
text: 'Finish applying',
};
Function sortListByFuzzyMatch
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function sortListByFuzzyMatch(value, list, prop = 'label') {
return list
.map(option => {
const label = option[prop].toUpperCase().replace(/[^a-zA-Z ]/g, '');
const val = value.toUpperCase().replace(/[^a-zA-Z ]/g, '');
Function focusElement
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function focusElement(selectorOrElement, options = {}, root) {
function applyFocus(el) {
if (el) {
// Use getAttribute to grab the "tabindex" attribute (returns string), not
// the "tabIndex" property (returns number). Focusable elements will
Function handleAdd
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleAdd() {
const numberOfItems = this.props.formData.length;
const lastIndex = numberOfItems - 1;
if (errorSchemaIsValid(this.props.errorSchema[lastIndex])) {
Function vaDateCommonFieldMapping
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function vaDateCommonFieldMapping(props) {
const {
description,
textDescription,
DescriptionField,
Function sortListByFuzzyMatch
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function sortListByFuzzyMatch(value, list, prop = 'label') {
return list
.map(option => {
const label = option[prop].toUpperCase().replace(/[^a-zA-Z ]/g, '');
const val = value.toUpperCase().replace(/[^a-zA-Z ]/g, '');
Function phoneUiSchema
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const phoneUiSchema = fieldName => {
return {
inputPhoneNumber: {
'ui:title': `${fieldName} (U.S. numbers only)`,
'ui:webComponentField': VaTextInputField,
Function Pending
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Pending(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.
Function updateUiSchema
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function updateUiSchema(schema, uiSchema, formData) {
if (!uiSchema) {
return uiSchema;
}
Function handleSubmit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleSubmit = event => {
if (!event.target.value) {
setInputError(true);
return;
}
Function ConfirmCancelModal
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ConfirmCancelModal = props => {
const { activeSection, closeModal, onHide, isVisible } = props;
// return null to avoid even having the web component in dom
// when not needed (this makes testing easier as well)
Function navigateForward
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const navigateForward = (SHORT_NAME, formResponses, router) => {
const roadmap = makeRoadmap(getServicePeriodResponse(formResponses));
if (roadmap?.length) {
const CURRENT_INDEX = roadmap?.indexOf(SHORT_NAME);
Function checkResponses
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const checkResponses = (formResponses, displayConditionsForPath) => {
const questionRequirements = Object.keys(displayConditionsForPath);
for (const questionShortName of questionRequirements) {
const formResponse = formResponses?.[questionShortName];
Function renderMarkers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderMarkers = locations => {
if (locations.length === 0) return;
const locationBounds = new mapboxgl.LngLatBounds();
Function recordSearchResultsEvents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const recordSearchResultsEvents = (props, results) => {
const dataPush = { event: 'fl-search-results' };
const { currentQuery, pagination, resultTime } = props;
if (currentQuery) {