Showing 3,945 of 13,747 total issues
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 Documents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function Documents({ formData }) {
const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
const hasDisabledChild = (formData.dependents || []).some(childIsDisabled);
const hasSchoolChild = (formData.dependents || []).some(childAttendsCollege);
const hasAdoptedChild = (formData.dependents || []).some(childIsAdopted);
- 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 showSeparationLocation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const showSeparationLocation = formData => {
const { serviceInformation = {} } = formData || {};
const { servicePeriods, reservesNationalGuardService } = serviceInformation;
// moment(undefined) => today
- 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 isItemIncomplete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
isItemIncomplete: item =>
!item?.name ||
!item?.dateRange?.from ||
(!item?.dateRange?.to && !item?.currentlyEnrolled) ||
item?.degreeReceived === 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(props) {
super(props);
// In contrast to the normal array field, we don’t want to add an empty item
// and always show at least one item on the review page
const arrayData = (Array.isArray(props.arrayData) && props.arrayData) || [];
- 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 validateSSandSNGroup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const validateSSandSNGroup = (errors, values, formData) => {
if (
!(
(formData.whoIsYourQuestionAbout === 'Someone else' &&
formData.relationshipToVeteran ===
- 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 goPathAfterGettingITF
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const goPathAfterGettingITF = (
{ compensationIntent, pensionIntent },
formData,
goPath,
goNextPath,
- 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 IntroductionPageView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const IntroductionPageView = ({
devOnly,
route,
content,
ombInfo,
- 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 SearchControls
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SearchControls = props => {
const {
onSubmit,
locateUser,
geolocationInProgress,
- 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 AddressValidationRadio
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AddressValidationRadio = props => {
const { formData, setFormData } = props;
const [apiData, setApiData] = useState([]);
const [loading, isLoading] = 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 formatReviewDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const formatReviewDate = (dateString, monthYear = false) => {
if (dateString) {
let [year, month, day] = dateString.split('-', 3);
// dates (e.g. dob) are sometimes in this pattern: 'YYYYMMDD'
if (year.length > 4) {
- 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 isItemIncomplete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
isItemIncomplete: item =>
!item?.branch ||
!item?.dateRange?.from ||
(!item?.dateRange?.to && !item?.currentlyServing) ||
(!item?.currentlyServing && !item?.characterOfDischarge) ||
- 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 App
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const App = ({ children }) => {
const {
TOGGLE_NAMES: { accreditedRepresentativePortalFrontend: appToggleKey },
useToggleLoadingValue,
useToggleValue,
- 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 HouseholdExpensesExplainerWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const HouseholdExpensesExplainerWidget = ({
data,
goBack,
goForward,
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 ReviewControl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ReviewControl = ({
title,
isEditing,
position,
onEditClick,
- 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 validateResolutionAmount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateResolutionAmount = (errors, fieldData) => {
// fieldData is each individual debt object
const { debtType, resolutionComment, resolutionOption } = fieldData;
// not required for waiver
- 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
const ConfirmationPage = ({ form, download }) => {
const { response } = form.submission;
const { data } = form;
const renderLoseJobBlurb = () => {
- 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 OtherExpensesChecklist
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const OtherExpensesChecklist = ({
data,
goBack,
goForward,
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 FormQuestion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function FormQuestion({
question,
recordStart,
optionsConfig,
setQuestionValue,
- 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 getSubmissionType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getSubmissionType = selectedDebtsAndCopays => {
if (!selectedDebtsAndCopays.length) return 'debt-submission';
const hasDebts = selectedDebtsAndCopays.some(
selected => selected.debtType === DEBT_TYPES.DEBT,
- 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"