Showing 4,231 of 14,884 total issues
Function EvidencePrivateRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const EvidencePrivateRequest = ({
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 hasDuplicateLocation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const hasDuplicateLocation = (list, currentLocation, newForm = false) =>
!!list.find(location => {
const {
locationAndName,
evidenceDates,
- 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 StepTwo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const StepTwo = ({ formResponses }) => {
if (
formResponses[SHORT_NAME_MAP.REASON] ===
RESPONSES.REASON_DD215_UPDATE_TO_DD214
) {
- 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
Avoid deeply nested control flow statements. Open
if (formResponses[nextShortName]) {
localRoadMap.push(ROUTES?.[nextShortName]);
}
Avoid deeply nested control flow statements. Open
if (routeMap[routeMap.length - 1] !== ROUTES?.[nextShortName]) {
if (valueHasChanged) {
const index = routeMap.indexOf(ROUTES[SHORT_NAME]);
const newRouteMap = routeMap.slice(0, index + 1);
setRouteMap([...newRouteMap, ROUTES?.[nextShortName]]);
Function StepOne
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const StepOne = ({ formValues }) => {
if (formValues['4_reason'] === '8') {
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
Avoid deeply nested control flow statements. Open
} else if (
displayConditionsMet(nextShortName, formResponses) &&
!editMode
) {
if (routeMap[routeMap.length - 1] !== ROUTES?.[nextShortName]) {
Function chapterPages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const chapterPages = arrayBuilderPages(arrayBuilderOptions, pages => {
return {
addChildIntro: pages.introPage({
depends: formData => isChapterFieldRequired(formData, TASK_KEYS.addChild),
title: 'Add child',
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
export function submitTransformer(formConfig, form) {
const { data: formData, loadedData } = form;
const expandedPages = expandArrayPages(
createFormPageList(formConfig),
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 parseDateToDateObj
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const parseDateToDateObj = (date, template) => {
let newDate = date;
if (typeof date === 'string') {
if (date.includes('T')) {
newDate = parseISO((date || '').split('T')[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 DependentInformation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const DependentInformation = props => {
const { data, goToPath, setFormData } = props;
const { dependents = [] } = data;
const search = new URLSearchParams(window.location.search);
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
newBenefit,
serviceBenefitBasedOn,
transferredEduBenefits,
- 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 transformForSubmit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function transformForSubmit(formConfig, form) {
const transformedData = JSON.parse(
formsSystemTransformForSubmit(formConfig, form),
);
- 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 ApplicantRelationshipReviewPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function ApplicantRelationshipReviewPage(props) {
const { data, keyname = KEYNAME, primary = PRIMARY, secondary = SECONDARY } =
props || {};
const genOps = props.genOp || generateOptions;
const {
- 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 translateDateIntoMonthDayYearFormat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const translateDateIntoMonthDayYearFormat = (
dateString,
isDelimiting = false,
) => {
// Parse the date string as UTC
- 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 Search
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Search = ({ isDesktop, searchIsOpen }) => {
const [inputValue, setInputValue] = useState('');
const searchInput = document.getElementById(
'search-header-dropdown-input-field',
);
- 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 SearchResult
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const SearchResult = ({
officer,
key,
addressLine1,
addressLine2,
- 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 PageAnalysis
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const PageAnalysis = ({ page, pageName, urlPrefix }) => {
const formData = useSelector(state => state?.form?.data || {});
const hasCustomPage = isReactComponent(page?.CustomPage);
const hasCustomPageReview = isReactComponent(page?.CustomPageReview);
const hasUiSchema = page?.uiSchema && Object.keys(page?.uiSchema).length > 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 parseDateToDateObj
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const parseDateToDateObj = (date, template) => {
let newDate = date;
if (typeof date === 'string') {
if (date.includes('T')) {
newDate = parseISO((date || '').split('T')[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 DependentInformation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const DependentInformation = props => {
const { data, goToPath, setFormData } = props;
const { dependents = [] } = data;
const search = new URLSearchParams(window.location.search);
- 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"