Showing 3,724 of 12,675 total issues
Function toggleSMSNotificationsSuccess
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const toggleSMSNotificationsSuccess = (enrolled = true) => {
return [
rest.put(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
return res(
ctx.json({
Function folders
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function folders(state = initialState, action) {
switch (action.type) {
case FETCH_FOLDER_SUCCESS: {
const { attributes } = action.folder.data;
const messages = action.messages.data.map(message => message.attributes);
Function labsAndTestsReducer
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const labsAndTestsReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.LabsAndTests.GET: {
return {
...state,
Function MedicationsListSort
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MedicationsListSort = props => {
const { value, sortRxList } = props;
const history = useHistory();
const showRefillContent = useSelector(selectRefillContentFlag);
const [sortListOption, setSortListOption] = useState(value);
Function UNSAFE_componentWillReceiveProps
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
UNSAFE_componentWillReceiveProps(newProps) {
// When a user is logged in, the profile finishes loading after the component
// has mounted, so we check here.
// If we're done loading the profile, check to see if we should load or redirect
if (
- 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 buildAddressArray
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function buildAddressArray(location, titleCaseText = false) {
if (location && location.type === LocationType.CC_PROVIDER) {
const { address } = location.attributes;
if (!isEmpty(address)) {
- 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 19 (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 ShowAlertOrSip
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const ShowAlertOrSip = ({ basename, sipOptions, bottom }) => {
const loggedIn = useSelector(isLoggedIn);
// Verified LOA3?
const isVerified = useSelector(
state => selectProfile(state)?.verified || 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 DependentsPage
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const DependentsPage = ({
dependents,
editMode,
pastMode,
router,
- 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 LevelThreeLinks
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const LevelThreeLinks = ({
activeMenu,
menuSections,
setLevelTwoMenuOpen,
setLinkShouldFocus,
- 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 V1V3Page
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function V1V3Page() {
/** @param {import('react').FormEvent | import('@department-of-veterans-affairs/web-components/dist/types/components').VaSelectCustomEvent } evt */
function updateValue(evt) {
const { value, name } = /** @type {HTMLInputElement} */ (evt.target);
const display = document.getElementById(`${name}Value`);
- 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 TermsOfUse
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function TermsOfUse() {
const isAuthenticatedWithSiS = useSelector(isAuthenticatedWithOAuth);
const isAuthenticatedWithIAM = useSelector(isAuthenticatedWithSSOe);
const [isDisabled, setIsDisabled] = useState(false);
const [isMiddleAuth, setIsMiddleAuth] = useState(true);
- 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 ShowAlertOrSip
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const ShowAlertOrSip = ({ basename, sipOptions, bottom }) => {
const loggedIn = useSelector(isLoggedIn);
// Verified LOA3?
const isVerified = useSelector(
state => selectProfile(state)?.verified || 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 NearbyLocations
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const NearbyLocations = props => {
const [originalCoordinates, setOriginalCoordinates] = useState([]);
const [nearbyVADistances, setNearbyVADistances] = useState(false);
const dispatch = useDispatch();
- 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 V3BasePage
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function V3BasePage() {
/** @param {import('react').FormEvent | import('@department-of-veterans-affairs/web-components/dist/types/components').VaSelectCustomEvent } evt */
function updateValue(evt) {
const { value, name } = /** @type {HTMLInputElement} */ (evt.target);
const display = document.getElementById(`${name}Value`);
- 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 submitTransformer
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const submitTransformer = (formConfig, form) => {
const { data: formData } = form;
const primaryKey = formData['view:hasPrimaryCaregiver'] ? 'primary' : null;
const SecondaryOneKey = formData['view:hasSecondaryCaregiverOne']
? 'secondaryOne'
- 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 GrossMonthlyIncomeInput
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const GrossMonthlyIncomeInput = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
- 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 SpouseGrossMonthlyIncomeInput
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const SpouseGrossMonthlyIncomeInput = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
- 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 MessageThreadItem
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const MessageThreadItem = props => {
const dispatch = useDispatch();
const accordionItemRef = useRef();
const { message, isDraftThread, open, forPrint } = props;
const {
- 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 parseTestFile
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function parseTestFile(features, code) {
const stack = [];
const ast = parser.parse(code, { sourceType: 'module', plugins: ['jsx'] });
traverse.default(ast, {
enter(path) {
- 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"