Showing 3,724 of 12,675 total issues
File labels.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import constants from 'vets-json-schema/dist/constants.json';
export const militaryBranches = [
'Air Force',
'Army',
File SmApi.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/exports';
import { DefaultFolders, threadSortingOptions } from '../util/constants';
const apiBasePath = `${environment.API_URL}/my_health/v1`;
File VAFacilityPageV2.jsx
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useEffect } from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
import SchemaForm from 'platform/forms-system/src/js/components/SchemaForm';
import { usePrevious } from 'platform/utilities/react-hooks';
Function isValidForm
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function isValidForm(form, pageList, isTesting = false) {
const pageListMap = new Map();
pageList.forEach(page => pageListMap.set(page.pageKey, page));
const validPages = Object.keys(form.pages).filter(pageKey =>
isActivePage(find(pageList, { pageKey }), form.data),
Function reduceErrors
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
errors.reduce((processedErrors, error) => {
let errorIndex = null; // save key (index) of array items with __error
const findErrors = (name, err) => {
if (err && typeof err === 'object') {
// process the last type of error message which provides an `__errors`
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div>
<h2 className="confirmation-page-title">
Thank you for signing up for our coronavirus research volunteer list
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div>
<h2 className="confirmation-page-title">
Thank you for signing up for our coronavirus research volunteer list
Function listItems
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const listItems = dependents.map((item, index) => {
const { fullName, dependentRelation } = item;
const dependentName = normalizeFullName(fullName);
const modalDescription = replaceStrValues(
content['household-dependent-modal-remove-description'],
Function validateAddress
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const validateAddress = (formData, fullName) => async (
dispatch,
getState,
) => {
dispatch({ type: ADDRESS_VALIDATION_START });
Function listItems
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const listItems = dependents.map((item, index) => {
const { fullName, dependentRelation } = item;
const dependentName = normalizeFullName(fullName);
const modalDescription = replaceStrValues(
content['household-dependent-modal-remove-description'],
Function Demographics
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Demographics = props => {
const dispatch = useDispatch();
const selectVeteranData = useMemo(makeSelectVeteranData, []);
const { t } = useTranslation();
const { demographics } = useSelector(selectVeteranData);
Function questionStatus
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const questionStatus = () => {
if (hasError) {
return (
<>
<p>
Function updateFormData
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateFormData = e => {
e.preventDefault();
if (isEditing) {
// find the one we are editing in the employeeRecords array
const updatedRecords = employmentRecords.map((item, arrayIndex) => {
Function InterstitialPage
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InterstitialPage = props => {
const { acknowledge, type } = props;
useEffect(() => {
focusElement(document.querySelector('h1'));
Function AuthorizedRoutes
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AuthorizedRoutes = () => {
const contactListPage = useSelector(
state =>
state.featureToggles[
FEATURE_FLAG_NAMES.mhvSecureMessagingEditContactList
Function FacilityCheckboxGroup
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FacilityCheckboxGroup = props => {
const {
facilityName,
multipleFacilities,
triageTeams,
Function AppointmentListSection
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AppointmentListSection() {
useManualScrollRestoration();
const featureBreadcrumbUrlUpdate = useSelector(state =>
selectFeatureBreadcrumbUrlUpdate(state),
Function LabAndTestDetails
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LabAndTestDetails = () => {
const dispatch = useDispatch();
const labAndTestDetails = useSelector(
state => state.mr.labsAndTests.labsAndTestsDetails,
);
Function conditionReducer
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const conditionReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.Conditions.GET: {
return {
...state,
Function buildNonVAPrescriptionPDFList
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const buildNonVAPrescriptionPDFList = prescription => {
return [
{
sections: [
{