Showing 4,177 of 14,709 total issues
Function VetCenterInfoSection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function VetCenterInfoSection(props) {
const attrs = {
opStatus: props.vetCenter.fieldOperatingStatusFacility,
opStatusExtra: props.vetCenter.fieldOperatingStatusMoreInfo,
};
- 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 FacilityPatientSatisfactionScoresWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function FacilityPatientSatisfactionScoresWidget(props) {
if (props.loading || !Object.keys(props.facility).length) {
return (
<va-loading-indicator message="Loading facility patient satisfaction scores..." />
);
- 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 ConfirmationPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ConfirmationPage = ({
getClaimStatus,
claimStatus,
user,
userEmail,
- 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 DuplicateContactInfoModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function DuplicateContactInfoModal(props) {
useEffect(
() => {
const allPotentialDuplicates = props?.duplicateEmail?.concat(
props?.duplicatePhone,
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (this.state.loading) {
return <va-loading-indicator message="Loading 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 TravelReview
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TravelReview = props => {
const { router } = props;
const { t } = useTranslation();
const selectForm = useMemo(makeSelectForm, []);
const { data } = useSelector(selectForm);
- 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 deriveEndsAtUnix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const deriveEndsAtUnix = (
startsAtUnix,
endDateMonth,
endDateDay,
endDateYear,
- 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 ActionLink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ActionLink = props => {
const { action, appointmentId, app, startTime } = props;
const { t } = useTranslation();
const { getPreCheckinComplete } = useStorage(app);
- 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 TravelClaimDetails
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function TravelClaimDetails() {
const { id } = useParams();
const location = useLocation();
const { claimDetailsProps = null } = location.state ?? {};
const [claimDetails, setClaimDetails] = useState(claimDetailsProps);
- 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 updateFormPages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const updateFormPages = (
patientDemographicsStatus,
pages,
URLS,
isTravelReimbursementEnabled = 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 DuplicateContactInfoModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function DuplicateContactInfoModal(props) {
useEffect(
() => {
const allPotentialDuplicates = props?.duplicateEmail?.concat(
props?.duplicatePhone,
- 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 ui:validations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
(errors, value, formData) => {
if (formData.burialDate && formData.deathDate) {
const death = new Date(formData.deathDate);
const burial = new Date(formData.burialDate);
- 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 mapStateToProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mapStateToProps = state => {
const { featureToggles } = state;
const selectedAddress = state.form?.data['view:currentAddress'];
const shippingAddress = state.form?.data[selectedAddress];
const { fullName, vetEmail, order, supplies } = state.form?.data;
- 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 IndividualsInvolvedCard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function IndividualsInvolvedCard({ formData }) {
const { name } = formData;
let displayTitle;
if (name.first || name.last) {
displayTitle = `${name.first || ''} ${name.last || ''}`;
- 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 verifyVaFileNumber
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const verifyVaFileNumber = () => async dispatch => {
dispatch({ type: VERIFY_VA_FILE_NUMBER_STARTED, response: true });
let response = await getVaFileNumber();
if (response.errors) {
Sentry.captureMessage('disability-file-number-gate-failed');
- 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 FileBDDClaim
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const FileBDDClaim = ({ getPageStateFromPageName, setWizardStatus }) => {
const stateBDD = getPageStateFromPageName('bdd');
const label = 'File a BDD disability claim online';
const linkText = 'Learn more about the BDD program';
- 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 validateZipCode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateZipCode = (zipCode, stateCode, errors) => {
if (stateCode in MILITARY_BASE_ZIP_REGEX) {
if (!zipCode.match(MILITARY_BASE_ZIP_REGEX[stateCode])) {
errors.addError(INVALID_ZIP_ERROR);
return 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 FileBDDClaim
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const FileBDDClaim = ({ data = {} }) => {
const { radDate } = data;
const differenceBetweenDatesInDays = getDiffInDays(radDate) + 1;
- 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 addServicePeriod
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const addServicePeriod = (formData, separationDate, setFormData) => {
const updateData = newData => {
window.sessionStorage.removeItem(SAVED_SEPARATION_DATE);
setFormData({
...newData,
- 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 validateSeparationDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateSeparationDate = (
errors,
dateString,
_formData,
_schema,
- 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"