Showing 4,231 of 14,884 total issues
Function generateProgressNoteContent
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const generateProgressNoteContent = record => {
const content = {
details: {
header: 'Details',
items: [
Function focusElement
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function focusElement(selectorOrElement, options = {}, root) {
function applyFocus(el) {
if (el) {
// Use getAttribute to grab the "tabindex" attribute (returns string), not
// the "tabIndex" property (returns number). Focusable elements will
- 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 checkResponses
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const checkResponses = (formResponses, displayConditionsForPath) => {
const questionRequirements = Object.keys(displayConditionsForPath);
for (const questionShortName of questionRequirements) {
const formResponse = formResponses?.[questionShortName];
- 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 alertMessage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const alertMessage = (alertType, appType) => {
switch (alertType) {
case ALERT_TYPES.ALL_ZERO:
return {
alertStatus: 'info',
- 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 prefillTransformerV1
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function prefillTransformerV1(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
const contactInfo = claimant?.contactInfo || {};
- 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 prefillTransformerV2
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function prefillTransformerV2(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
const contactInfo = claimant?.contactInfo || {};
- 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 prefillTransformerV4
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function prefillTransformerV4(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
const contactInfo = claimant?.contactInfo || {};
- 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 SearchResults
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const SearchResults = ({
error,
fetching,
page,
query,
- 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 mapBenefitFromFormInputData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const mapBenefitFromFormInputData = (benefit, formData) => {
if (checkExtraConditions(benefit, formData) === false) return false;
const mappingKeys = Object.keys(mappingTypes);
// Each mapping type (i.e. GOALS).
- 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 NearByVetCenters
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const NearByVetCenters = props => {
const [originalCoordinates, setOriginalCoordinates] = useState([]);
const [fetchedVetCenters, setFetchedVetCenters] = useState([]);
const [nearbyVetCenterDistances, setNearbyVetCenterDistances] = 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 deriveEventLocations
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const deriveEventLocations = event => {
const locations = [];
if (!event) {
return locations;
- 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 UpcomingAppointmentsListItem
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const UpcomingAppointmentsListItem = props => {
const { app, appointment, goToDetails, router, border, count } = props;
const { t } = useTranslation();
const { getCurrentPageFromRouter } = useFormRouting(router);
const page = getCurrentPageFromRouter();
- 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 createMockSuccessResponse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const createMockSuccessResponse = (
token,
demographicsNeedsUpdate = false,
demographicsConfirmedAt = null,
nextOfKinNeedsUpdate = 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 prefillTransformer
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function prefillTransformer(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const contactInfo = claimant?.contactInfo || {};
const stateUser = state.user;
- 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 confirmationPageAlertParagraphV2
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const confirmationPageAlertParagraphV2 = ({
formData,
submissionApi,
expirationDate,
confirmationNumber = '',
- 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 getHealthFacilityTitle
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const getHealthFacilityTitle = data => {
const {
YOUR_VA_HEALTH_FACILITY,
VETERAN_VA_HEALTH_FACILITY,
FAMILY_MEMBER_VA_HEALTH_FACILITY,
- 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 SpouseEmploymentQuestion
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const SpouseEmploymentQuestion = props => {
const {
data,
goBack,
goToPath,
- 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 PreSubmitSignature
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const PreSubmitSignature = ({
formData,
showError,
onSectionComplete,
formSubmission,
- 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 YourClaimLetters
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const YourClaimLetters = ({ isLoading, showClaimLetters }) => {
const [currentItems, setCurrentItems] = useState([]);
const [currentPage, setCurrentPage] = useState(1);
const [lettersLoading, setLettersLoading] = useState(true);
// Using `useRef` here to avoid triggering a rerender whenever these are
- 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 YellowRibbonSelector
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const YellowRibbonSelector = ({ programs }) => {
const mappedPrograms = programs.map(program => ({
degreeLevel: program.degreeLevel,
divisionProfessionalSchool: program.divisionProfessionalSchool,
numberOfStudents: program.numberOfStudents,
- 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"