Showing 3,736 of 12,814 total issues
Function Vitals
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const Vitals = () => {
const dispatch = useDispatch();
const updatedRecordList = useSelector(state => state.mr.vitals.updatedList);
const listState = useSelector(state => state.mr.vitals.listState);
const vitals = useSelector(state => state.mr.vitals.vitalsList);
- 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
Function extractObservedReported
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const extractObservedReported = allergy => {
if (allergy && isArrayAndHasItems(allergy.extension)) {
const extItem = allergy.extension.find(
item => item.url && item.url.includes('allergyObservedHistoric'),
);
- 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
Function CernerFacilityAlert
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const CernerFacilityAlert = ({ className = '' }) => {
const ehrDataByVhaId = useSelector(
state => state.drupalStaticData?.vamcEhrData?.data?.ehrDataByVhaId,
);
const userFacilities = useSelector(state => state?.user?.profile?.facilities);
- 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
Function formatMenuItems
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const formatMenuItems = menuItems => {
const formattedMenuItems = [];
if (menuItems && isArray(menuItems)) {
return menuItems;
Function userNavReducer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function userNavReducer(state = initialState, action) {
switch (action.type) {
case TOGGLE_FORM_SIGN_IN_MODAL:
return set('showFormSignInModal', action.isOpen, state);
Function textUI
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const textUI = stringOrOptions => {
if (typeof stringOrOptions === 'string') {
return {
'ui:title': stringOrOptions,
'ui:webComponentField': VaTextInputField,
Function querySelectorWithShadowRoot
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function querySelectorWithShadowRoot(selector, root) {
try {
let selectorElement;
const rootElement =
typeof root === 'string'
Function ArnField
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ArnField(fieldProps) {
const props = vaTextInputFieldMapping(fieldProps);
const [val, setVal] = useState(props.value);
const [displayVal, setDisplayVal] = useState(props.value);
Function formsPatternFieldMapping
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function formsPatternFieldMapping(props) {
const { uiOptions = {} } = props;
const {
useFormsPattern,
formHeading,
Function textareaUI
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const textareaUI = stringOrOptions => {
if (typeof stringOrOptions === 'string') {
return {
'ui:title': stringOrOptions,
'ui:webComponentField': VaTextareaField,
Function profileInformation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function profileInformation(state = initialState, action) {
switch (action.type) {
case UPDATE_PROFILE_FIELDS: {
const newState = mapRawUserDataToState(action.payload);
return { ...state, ...newState };
Function mainTransform
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mainTransform = formData => {
const informalConference = formData.informalConference !== 'no';
const attributes = {
// This value may empty if the user restarts the form; see
// va.gov-team/issues/13814
Function fetchTotalDisabilityRating
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fetchTotalDisabilityRating() {
return dispatch => {
const {
FETCH_DISABILITY_RATING_STARTED,
FETCH_DISABILITY_RATING_FAILED,
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
captureEvents.ineligibilityAlert(this.props);
return (
<div>
{this.renderHeader()}
Function FinancialStatusConfirmation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FinancialStatusConfirmation = props => {
const {
goBack,
goForward,
contentBeforeButtons,
Function errorAddressAlert
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const errorAddressAlert = deliveryPointValidation => {
if (deliveryPointValidation === BAD_UNIT_NUMBER) {
return (
<Alert
status="warning"
Function compareAddressObjects
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function compareAddressObjects(obj1, obj2) {
const { hasOwnProperty } = Object.prototype;
const keys1 = Object.keys(obj1);
const keys2 = Object.keys(obj2);
Function MailOrFaxFilesContent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MailOrFaxFilesContent = () => {
return (
<>
<p>
We can process your request more quickly if you upload your files here.
Function MissingEDIPI
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MissingEDIPI = () => {
recordEvent({
event: 'visible-alert-box',
'alert-box-type': 'error',
'alert-box-heading': 'We need more information for your application',
Function updateAddress
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateAddress = (state = initialState, action) => {
switch (action.type) {
case UPDATE_ADDRESS:
return {
...state,