Showing 4,231 of 14,884 total issues
Function DisabilityRating
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DisabilityRating = () => {
const hasError = useSelector(totalDisabilityError);
const rating = useSelector(state => state.totalRating?.totalDisabilityRating);
const canAccessRatingInfo = useSelector(canAccess)?.[API_NAMES.RATING_INFO];
Function useDowntimeApproachingRenderMethod
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function useDowntimeApproachingRenderMethod() {
const [modalDismissed, setModalDismissed] = useState(false);
return (downtime, children) => {
if (downtime.status === externalServiceStatus.downtimeApproaching) {
Function sections
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map(listItem => {
const object = { header: '', headerSize: 'H2', items: [] };
object.header = listItem.text;
const index = list.indexOf(listItem);
const nextHeader = list
Function ClaimantType
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ClaimantType = props => {
const { formData, router, setFormData, loggedIn } = props;
const [localData, setLocalData] = useState({});
Function generateDetailsContentSets
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const generateDetailsContentSets = async (doc, parent, data) => {
const details = doc.struct('Sect', {
title: 'Details',
});
parent.add(details);
- 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 generateDetailsContentSets
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const generateDetailsContentSets = async (doc, parent, data) => {
const details = doc.struct('Sect', {
title: 'Details',
});
parent.add(details);
- 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 MenuItemLevel1
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const MenuItemLevel1 = ({
expandedMenuID,
item,
updateExpandedMenuID,
}) => {
- 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 uiSchemaValidate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function uiSchemaValidate(
errors,
uiSchema,
schema,
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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { idSchema, formContext, formData, uiSchema, schema } = this.props;
const id = idSchema.$id;
// wrap matching text in a <span> element
- 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 checkTypeAndExtensionMatches
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function checkTypeAndExtensionMatches({ file, result }) {
// file.name and file.type may be undefined in some browsers, see
// https://developer.mozilla.org/en-US/docs/Web/API/File#browser_compatibility
const extension = (file.name || '')
.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 determineResultsPage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const determineResultsPage = (formResponses, router) => {
const responseToServicePeriod = getServicePeriodResponse(formResponses);
const { RESULTS_4 } = SHORT_NAME_MAP;
const resultsPages = DISPLAY_CONDITIONS?.RESULTS;
- 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 getLatestDebt
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getLatestDebt = debts => {
return debts
? debts.reduce((acc, curr) => {
const mostRecentHistory = head(curr.debtHistory);
if (mostRecentHistory) {
- 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 sessionTypeUrl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function sessionTypeUrl({
type = '',
queryParams = {},
version = API_VERSION,
allowVerification = 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 getLatestBill
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getLatestBill = bills => {
return bills
? bills.reduce((acc, currBill) => {
if (currBill.pSStatementDateOutput) {
if (!acc) {
- 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 AreaOfDisagreement
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const AreaOfDisagreement = ({
data = {},
pagePerItemIndex,
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 StepOne
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const StepOne = ({ formResponses }) => {
const reason = formResponses[SHORT_NAME_MAP.REASON];
const specialReason = [
RESPONSES.REASON_PTSD,
RESPONSES.REASON_TBI,
- 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 answerReview
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const answerReview = (key, formValues) => {
const ans = formValues[key];
const dischargeYearLabel = prevApplicationYearCutoff[formValues['4_reason']];
const monthObj = options.months.find(
m => String(m.value) === formValues['3_dischargeMonth'],
- 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 InboxPage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const InboxPage = ({
claimStatus,
getClaimStatus,
user,
MEBClaimStatusFetchInProgress,
- 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 PreSubmitNotice
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function PreSubmitNotice({
formData,
showError,
onSectionComplete,
setPreSubmit,
- 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"