Showing 3,724 of 12,675 total issues
Function ContestableIssuesWidget
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ContestableIssuesWidget = props => {
const {
value = [],
id,
options,
Function useNotificationSettingsUtils
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useNotificationSettingsUtils = () => {
const communicationPreferences = useSelector(
state => state?.communicationPreferences,
);
Function NewAppointment
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function NewAppointment() {
const isCernerOnlyPatient = useSelector(selectIsCernerOnlyPatient);
const isNewAppointmentStarted = useSelector(selectIsNewAppointmentStarted);
const featureBreadcrumbUrlUpdate = useSelector(state =>
selectFeatureBreadcrumbUrlUpdate(state),
File ProfileInformationFieldController.jsx
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
// platform level imports
Function Confirmation
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Confirmation = () => {
useEffect(() => {
focusElement('#main h2');
scrollTo('topScrollElement');
});
File ApiInitializer.js
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import session from '../mocks/v2/sessions';
import preCheckInData from '../mocks/v2/pre-check-in-data';
import checkInData from '../mocks/v2/check-in-data';
import btsss from '../mocks/v2/btsss';
import sharedData from '../mocks/v2/shared';
Function ConfirmationPageV2
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ConfirmationPageV2 = () => {
const alertRef = useRef(null);
const form = useSelector(state => state.form || {});
const profile = useSelector(state => selectProfile(state));
Function generateData
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
Open
const generateData = (type, formData) => {
switch (type) {
case 'claimant-information':
return {
'Claimant’s first name': formData?.claimantFullName?.first
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File DeceasedPersons.jsx
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import Scroll from 'react-scroll';
import {
File ProfileInformationFieldController.jsx
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
// platform level imports
File debtDetailsCardContent.js
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
import { endDate } from '../../utils/helpers';
const ContactDMC = () => (
Function MyVAHealth
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function MyVAHealth() {
const [{ loadingMessage, isLoading }, setLoadingMessage] = useState(
defaultMessage,
);
const [showDeclineModal, setShowDeclineModal] = useState(false);
Function renderResults
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderResults() {
const { searchGovMaintenance } = this.props;
const {
loading,
errors,
Function uiSchema
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function uiSchema(
label = 'Address',
useStreet2 = true,
useStreet3 = false,
isRequired = null,
Function transform
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function transform(formConfig, form) {
// Grab isBDD before things are changed/deleted
const isBDDForm = isBDD(form.data);
// Grab ratedDisabilities before they're deleted in case the page is inactive
// We need to send all of these to vets-api even if the veteran doesn't apply
File ArrayField.jsx
has 500 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import Scroll from 'react-scroll';
File index.js
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const all = [
{
id: 5621490,
reasonForStudy: null,
radiologist: 'DOE,JOHN',
Function uiSchema
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function uiSchema(
label = 'Address',
useStreet3 = false,
isRequired = null,
ignoreRequired = false,
Function render
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
uiSchema,
errorSchema,
idSchema,
Function NoFormPage
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const NoFormPage = () => {
const [data, setData] = useState({});
const [loading, setLoading] = useState(false);
const loggedIn = useSelector(isLoggedIn);