Showing 4,231 of 14,884 total issues
Function mergeRadiologyLists
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const mergeRadiologyLists = (
phrRadiologyTestsList,
cvixRadiologyTestsList,
) => {
const mergedArray = [];
- 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 getLatestCopay
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getLatestCopay = statements => {
if (!statements) return null;
return statements.reduce((acc, currentCopay) => {
if (currentCopay.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 mockGetRefreshStatus
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const mockGetRefreshStatus = () => {
switch (scenario) {
case 1: {
return STALE;
}
- 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 RadiologySingleImage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const RadiologySingleImage = () => {
const dispatch = useDispatch();
const { labId, imageId } = useParams();
// const labAndTestDetails = useSelector(
// state => state.mr.labsAndTests.labsAndTestsDetails,
- 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 handleDataDogAction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const handleDataDogAction = ({
locationBasePath,
locationChildPath,
sendAnalytics = true,
}) => {
- 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 buildMedicationInformationPDF
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const buildMedicationInformationPDF = list => {
const listOfHeaders = ['h2', 'h3'];
const sections = [
...list
.filter(listItem => listOfHeaders.includes(listItem.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 pdfTransform
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function pdfTransform(formData) {
const {
veteranFullName,
veteranSocialSecurityNumber: ssn,
vaFileNumber,
- 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 uploadFile
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
file,
uiOptions,
onProgress,
onChange,
onError,
Function validateMilitaryCity
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
errors,
city,
formData,
schema,
messages,
Function validateMilitaryState
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
errors,
state,
formData,
schema,
messages,
Function uiSchema
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
subHeader = veteranApplicantDetailsSubHeader,
description = '',
nameUI = nonPreparerFullMaidenNameUI,
ssnUI = ssnDashesUI,
dateOfBirthUI = nonPreparerDateOfBirthUI,
Function uiSchema
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
subHeader = veteranApplicantDetailsSubHeader,
description = '',
nameUI = nonPreparerFullMaidenNameUI,
ssnUI = ssnDashesUI,
dateOfBirthUI = nonPreparerDateOfBirthUI,
Function generateHeaderBanner
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const generateHeaderBanner = async (doc, header, data, config) => {
doc.moveDown(1);
const currentHeight = doc.y;
// Calculate text width
- 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 setupJSDom
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function setupJSDom() {
// Prevent warnings from displaying
/* eslint-disable no-console */
if (process.env.LOG_LEVEL === 'debug') {
console.error = (error, reactError) => {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
export default function addFocusBehaviorToCrisisLineModal() {
const overlay = document.getElementById('modal-crisisline');
const modal = document.querySelector('.va-crisis-panel.va-modal-inner');
const tabbableElements = getTabbableElements(modal);
let openControl;
- 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 (sortOrder === 'ASC') {
return a.attributes.recipientName.localeCompare(
b.attributes.recipientName,
);
}
Function parseStringOrDate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function parseStringOrDate(date) {
if (date instanceof Date) {
return date;
}
- 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 saveForm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function saveForm(saveType, formId, formData, version, returnUrl, submission) {
Function statementOfTruthFullName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function statementOfTruthFullName(
formData,
statementOfTruth,
profileFullName,
) {
- 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 saveFormApi
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
formId,
formData,
version,
returnUrl,
savedAt,