Showing 4,231 of 14,884 total issues
Function DownloadHandler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const DownloadHandler = ({
clickedId,
downloadUrl,
form,
formNumber,
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
isItemIncomplete: item =>
!item?.fullName?.first ||
!item?.fullName?.last ||
!item?.birthDate ||
!item?.ssn ||
- 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 DependentSummary
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const DependentSummary = props => {
const {
data,
goBack,
goForward,
- 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 compareAddressObjects
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function compareAddressObjects(obj1, obj2) {
const { hasOwnProperty } = Object.prototype;
const keys1 = Object.keys(obj1);
const keys2 = Object.keys(obj2);
- 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 getGroupedPreviousEnrollments
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getGroupedPreviousEnrollments = month => {
const { transactDate, actBegin, actEnd, id, paymentDate } = month[0];
const myUUID = uuidv4();
return (
- 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 addFocusBehaviorToCrisisLineModal
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const addFocusBehaviorToCrisisLineModal = () => {
const overlay = document?.getElementById('ts-modal-crisisline');
const modal = document?.querySelector('.vcl-crisis-panel.va-modal-inner');
if (modal) {
- 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 DependentSummary
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const DependentSummary = props => {
const {
data,
goBack,
goForward,
- 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 GroupCheckboxWidget
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const GroupCheckboxWidget = props => {
const { value, options, formContext, onChange } = props;
const { onReviewPage, reviewMode } = formContext || {};
const { labels } = options;
- 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 RatedDisabilityList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function RatedDisabilityList({
fetchRatedDisabilities,
ratedDisabilities,
sortToggle,
}) {
- 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 DependentSummary
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const DependentSummary = props => {
const {
data,
goBack,
goForward,
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
export const submitTransformer = (formConfig, form) => {
let dataToMap = JSON.parse(transformForSubmit(formConfig, form));
// map Veteran address data if mailing and home addresses match
if (form.data['view:doesMailingMatchHomeAddress']) {
- 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 createRoutesWithStore
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const createRoutesWithStore = () => {
return (
<Switch>
{routes.map((route, i) => {
const options = { appName: APP_NAMES.PRE_CHECK_IN };
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
let paymentsReceivedTable = '';
let paymentsReturnedTable = '';
let content;
// If the app is loading, show a loading LoadingIndicator
- 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 12 (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 customFormReplacer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const customFormReplacer = (key, value) => {
// clean up empty objects, which we have no reason to send
if (typeof value === 'object') {
const fields = Object.keys(value);
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 setReviewTitle
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const setReviewTitle = (title, index, formType) => formData => {
const additionalIncidentKeyIndex = index === 0 ? index : index - 1;
const additionalIncidentKey = `view:enterAdditional${
formType === '781a' ? 'Secondary' : ''
}Events${additionalIncidentKeyIndex}`;
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
const ConfirmationPage = ({ route }) => {
const form = useSelector(state => state.form);
const loggedIn = useSelector(isLoggedIn);
const { formConfig } = route;
const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
- 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 updateFormData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const updateFormData = (oldFormData, formData) => {
let { city, state } = formData.mailingAddress;
const onMilitaryBase = getMilitaryValue(formData);
if (getMilitaryValue(oldFormData) !== onMilitaryBase) {
if (onMilitaryBase) {
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
export const transform = (formConfig, form) => {
const {
questions,
personalIdentification,
personalData: {
- 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 ContactInfoReview
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const ContactInfoReview = ({ data, editPage }) => {
const editRef = useRef(null);
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"