Showing 4,177 of 14,709 total issues
Function deselectBasedOnValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static deselectBasedOnValue(name, value, formData, properties) {
// derive the notListedTextKey by looking at the form schema properties for a 'string' field type
// be aware this logic limits the usage to a single text field for a 'write in' style field
const notListedTextKey = Object.entries(properties).reduce(
(previous, [propertyKey, { type }]) => {
- 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 createKeywordsArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const createKeywordsArray = query => {
return query
.split(' ')
.filter(word => !!word)
.map(keyword => keyword.toLowerCase())
- 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 DebtDetails
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const DebtDetails = () => {
const { selectedDebt, debts } = useSelector(
({ combinedPortal }) => combinedPortal.debtLetters,
);
const approvedLetterCodes = ['100', '101', '102', '109', '117', '123', '130'];
- 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 createExternalApplicationUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const createExternalApplicationUrl = () => {
const { application, to } = getQueryParams();
if (!application) {
return null;
}
- 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 evaluateOneOfChoices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const evaluateOneOfChoices = (oneOfChoices, formResponses) => {
for (const choice of Object.keys(oneOfChoices)) {
if (
Array.isArray(oneOfChoices[choice]) &&
validateMultiCheckboxResponses(
- 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 OverviewPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const OverviewPage = () => {
const title = 'Your VA debt and bills';
useHeaderPageTitle(title);
useEffect(() => {
- 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 ui:validations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
(errors, field) => {
if (!isValidName(field)) {
if (field.length === 0) {
errors.addError('Please enter your first name');
} else if (field[0] === ' ' || field[0] === "'") {
- 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 buildEventData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const buildEventData = formData => {
const { informalConference, informalConferenceChoice } = formData;
let informalConf = 'no';
if (
(showNewHlrContent(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 ServicePeriodAccordionView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function ServicePeriodAccordionView({ formData }) {
const {
separationReason,
serviceBranch,
serviceCharacter,
- 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 ProviderServiceDescription
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ProviderServiceDescription = ({ provider, details = false }) => {
if (details) {
const { specialty } = provider.attributes;
if (specialty && specialty.length < 1) return null;
- 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 ConfirmationPageV2
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ConfirmationPageV2 = () => {
const alertRef = useRef(null);
const form = useSelector(state => state.form || {});
const profile = useSelector(state => selectProfile(state));
- 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 createComments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function createComments(submissionForm) {
if (submissionForm['view:serviceHistory'].serviceHistoryIncorrect) {
if (submissionForm.incorrectServiceHistoryExplanation) {
return {
claimantComment: {
- 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 formatHours
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const formatHours = hours => {
// Eg starthours: 700 endhours: 1730
let hour = Number(
hours.toString().length > 3
? hours.toString().substring(0, 2)
- 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 _override
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_override: err => {
if (typeof err === 'string') {
if (
err?.startsWith('locations[') ||
err?.startsWith('providerFacility[')
- 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 getPhone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getPhone = formData => {
const data = formData || {};
const { veteran = {} } = data;
const primary = data[PRIMARY_PHONE] || '';
// we shouldn't ever get to this point without a home or mobile phone
- 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 = () => {
const alertRef = useRef(null);
const form = useSelector(state => state.form || {});
const { submission, formId, data = {} } = form;
const { fullName } = 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 getPhone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getPhone = formData => {
const data = formData || {};
const { veteran = {} } = data;
const primary = data[PRIMARY_PHONE] || '';
// we shouldn't ever get to this point without a home or mobile phone
- 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 EvidencePrivateRecordsAuthorization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const EvidencePrivateRecordsAuthorization = ({
data = {},
goBack,
goForward,
setFormData,
- 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"