Showing 4,231 of 14,884 total issues
Function getInput
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function getInput(input, uiSchema, schema) {
if (input && input.widget === 'autosuggest') {
return input.label;
}
- 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 BenefitsForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const BenefitsForm = ({
children,
cumulativeService,
eligForPostGiBill,
eligibilityChange,
- 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 RadioWidget
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function RadioWidget(props) {
const { options, formContext = {}, value, disabled, onChange, id } = props;
const { enumOptions, labels = {} } = options;
const onReviewPage = formContext?.onReviewPage || false;
- 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 getBlueButtonReportData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const getBlueButtonReportData = (
options = {},
dateFilter,
) => async dispatch => {
const fetchMap = {
- 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 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 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 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 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 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 mapStateToProps
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = (state, ownProps) => {
const { transaction } = ownProps;
const {
addressFromUser,
addressValidationError,
Function createMilitaryClaimant
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createMilitaryClaimant(submissionForm) {
// Access formField and viewComponent sources for userFullName and dateOfBirth
const formFieldUserFullName =
submissionForm['view:userFullName']?.userFullName;
const viewComponentUserFullName = submissionForm?.userFullName;
Function profileReducer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function profileReducer(state = getNullProfileState(), action) {
switch (action.type) {
case FETCH_USER:
return {
...state,
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 prefillTransformer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function prefillTransformer(pages, formData, metadata, state) {
const { homePhone, mobilePhone, email, remainingEntitlement } = formData;
const { edipi, icn } = state.user.profile;
const totalDays = remainingEntitlement
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,