Showing 4,231 of 14,884 total issues
Function getAppeals
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getAppeals() {
const startTimestampMs = Date.now();
return dispatch => {
dispatch({ type: FETCH_APPEALS_PENDING });
Function onUpdateClicked
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onUpdateClicked = async () => {
const addressState = {
...stateAndZip,
state: stateAndZip.stateCode,
};
Function Alert
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Alert = props => {
const { isAlertVisible, paginatedPrescriptionsList } = props;
return (
<div className={`${isAlertVisible ? 'vads-u-margin-top--5' : ''}`}>
Function pharmacyPhoneNumber
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const pharmacyPhoneNumber = prescription => {
if (prescription.cmopDivisionPhone) {
return prescription.cmopDivisionPhone;
}
if (prescription.dialCmopDivisionPhone) {
- 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 checkboxGroupUI
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const checkboxGroupUI = ({
title,
description,
errorMessages,
labels,
- 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 FormNav
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function FormNav(props) {
const {
formConfig = {},
currentPath,
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 updateFormDataAddress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const updateFormDataAddress = (
oldFormData,
formData,
path,
index = null, // this is included in the path, but added as
- 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 updateFormDataAddress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const updateFormDataAddress = (
oldFormData,
formData,
path,
index = null, // this is included in the path, but added as
- 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 validatePages
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function validatePages(orderedPageTypes) {
const pageTypes = {};
for (const pageType of orderedPageTypes) {
if (pageType === 'intro') {
if (pageTypes.intro || pageTypes.summary || pageTypes.item) {
- 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 getPropertyInfo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const getPropertyInfo = (pageList = [], name, instance = '') => {
const findPageIndex = (
obj,
insideInstance = instance === '' || instance === name,
) => {
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
export default function prefillTransformer(pages, formData, metadata) {
const newFormData = formData;
for (const addressType of ['permanentAddress', 'temporaryAddress']) {
if (newFormData[addressType]?.country) {
- 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 applyFocus
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
if (!headerHasFocused) {
setTimeout(() => {
const header = document
.getElementById(parentId)
- 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 navigateBackward
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const navigateBackward = (SHORT_NAME, formResponses, router) => {
const roadmap = makeRoadmap(getServicePeriodResponse(formResponses));
if (roadmap?.length) {
const CURRENT_INDEX = roadmap?.indexOf(SHORT_NAME);
- 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 InformalConferenceContact
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const InformalConferenceContact = ({
data,
goBack,
goForward,
onReviewPage,
- 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 BenefitRelinquishWidget
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const BenefitRelinquishWidget = ({ formData, setFormData }) => {
const { eligibility } = formData;
const [selected, setSelected] = useState('');
const chapter30 = eligibility?.includes('Chapter30');
- 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 getEvidence
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const getEvidence = formData => {
const evidenceSubmission = {
evidenceType: [],
};
const showNewFormContent = showScNewForm(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 applyFocus
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
if (!headerHasFocused) {
setTimeout(() => {
const header = document
.getElementById(parentId)
- 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 transform
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function transform(formConfig, form) {
const usFormTransform = () =>
JSON.parse(transformForSubmit(formConfig, form));
const prefillTransforms = 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 SearchForm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const SearchForm = ({ fetchForms }) => {
const query = new URLSearchParams(window.location.search).get('q') ?? '';
const [queryState, setQueryState] = useState(query);
const [showQueryError, setShowQueryError] = 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 transform
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function transform(formConfig, form) {
const newSchoolTransform = formData => {
let clonedData = _.cloneDeep(formData);
delete clonedData.newSchoolName;
delete clonedData.newSchoolAddress;
- 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"