Showing 4,177 of 14,709 total issues
Function Title
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const Title = ({
title,
description,
headerLevel = 3,
headerStyleLevel,
- 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 SaveStatus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function SaveStatus({
form: {
lastSavedDate,
autoSavedStatus,
loadedData,
- 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 currentOrPastDateUI
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const currentOrPastDateUI = options => {
const { title, errorMessages, required, ...uiOptions } =
typeof options === 'object' ? options : { title: options };
// if monthYearOnly is used, the schema pattern also needs
- 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 onNavBackRemoveAddingItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function onNavBackRemoveAddingItem({
arrayPath,
summaryRoute,
introRoute,
reviewRoute,
- 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 expandArrayPages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function expandArrayPages(pageList, data) {
const result = pageList.reduce(
(acc, nextPage) => {
const { lastArrayPath, arrayPages, currentList } = acc;
// If we see an array page and we’re starting a section or in the middle of one, just add it
- 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 hideFormTitle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function hideFormTitle(formConfig, pathName) {
if (
!formConfig?.chapters ||
typeof formConfig.chapters !== 'object' ||
formConfig.chapters.length === 0
- 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 getArrayFields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getArrayFields(data) {
const fields = [];
const findArrays = (obj, ui, path = []) => {
if (
obj.type === 'array' &&
- 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 parseISODate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function parseISODate(dateString) {
if (typeof dateString === 'string') {
const [year = 'XXXX', month = 'XX', day = 'XX'] = dateString.split('-', 3);
return {
- 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 formsPatternFieldMapping
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function formsPatternFieldMapping(props) {
const { uiOptions = {} } = props;
const {
useFormsPattern,
formHeading,
- 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 FormSignature
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const FormSignature = ({
signatureLabel,
checkboxLabel,
checkboxDescription,
formData,
- 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 removeHiddenData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function removeHiddenData(schema, data) {
// null is necessary here because Rails 4 will convert empty arrays to null
// In the forms, there's no difference between an empty array and null or undefined
if (isHiddenField(schema) || typeof data === 'undefined' || data === null) {
return undefined;
- 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 ErrorLinks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ErrorLinks = props => {
const { appType, testId, errors } = props;
const errorRef = useRef(null);
const [hadErrors, setHadErrors] = useState(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 phoneUISchema
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function phoneUISchema(category) {
return {
'ui:options': {
hideLabelText: true,
showFieldLabel: 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 createAndStoreReturnUrl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const createAndStoreReturnUrl = () => {
let returnUrl;
if (loginAppUrlRE.test(window.location.pathname)) {
if (isExternalRedirect()) {
returnUrl = createExternalApplicationUrl();
- 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 ConfirmRemoveModal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ConfirmRemoveModal = ({
cancelAction,
deleteAction,
title,
fieldName,
- 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 SelectedVeteranReviewPage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function SelectedVeteranReviewPage({ data, editPage, title }) {
let veteranName;
if (data[formFields.selectedVeteran] === VETERAN_NOT_LISTED_VALUE) {
const name = data[formFields.veteranFullName];
- 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 updateFormValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const updateFormValue = (SHORT_NAME, checkbox, state, action) => {
// Multi-checkbox responses
if (checkbox) {
const currentFormContents = state.form?.[SHORT_NAME];
const removeResponse = currentFormContents?.includes(action.payload);
- 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 CombinedPortalApp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CombinedPortalApp = ({ children }) => {
const dispatch = useDispatch();
const userLoggedIn = useSelector(state => isLoggedIn(state));
const isCombinedPortalActive = useSelector(state =>
combinedPortalAccess(state),
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const dataType = this.props.schema.type;
if (dataType !== 'array') {
throw new Error(`Data Type ${dataType} not supported.`);
}
- 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 data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
data: (state = initialState, action) => {
switch (action.type) {
case FETCH_EXCLUSION_PERIODS:
return {
...state,
- 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"