Showing 3,724 of 12,675 total issues
Function LocationSearchResults
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function LocationSearchResults({
search,
filters,
preview,
dispatchUpdateEligibilityAndFilters,
- 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 SchoolLocations
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
export default function SchoolLocations({
calculator,
constants,
eligibility,
facilityMap,
- 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
File form.js
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
// platform imports
import environment from 'platform/utilities/environment';
import { VA_FORM_IDS } from 'platform/forms/constants';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import ezrSchema from 'vets-json-schema/dist/10-10EZR-schema.json';
Function renderAdditionalInfo
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const renderAdditionalInfo = deductionCode => {
switch (deductionCode) {
case '30':
return (
<section>
Function SpouseGrossMonthlyIncomeInput
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SpouseGrossMonthlyIncomeInput = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
Function data
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: (state = initialState, action) => {
switch (action.type) {
case FETCH_EXCLUSION_PERIODS:
return {
...state,
Function createMockSuccessResponse
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createMockSuccessResponse = (
token,
demographicsNeedsUpdate = false,
demographicsConfirmedAt = null,
nextOfKinNeedsUpdate = false,
Function render
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { submission, data } = this.props.form;
const { response } = submission;
const veteranFirstName = data?.veteranInformation?.fullName?.first || '';
const veteranLastName = data?.veteranInformation?.fullName?.last || '';
Function GrossMonthlyIncomeInput
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GrossMonthlyIncomeInput = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
Function VaccineDetails
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VaccineDetails = props => {
const { runningUnitTest } = props;
const record = useSelector(state => state.mr.vaccines.vaccineDetails);
const vaccines = useSelector(state => state.mr.vaccines.vaccinesList);
const user = useSelector(state => state.user.profile);
Function render
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
uiSchema,
errorSchema,
idSchema,
Function render
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { supplies, order, eligibility } = this.props;
const currentDate = moment();
const apneaSupplies = supplies.filter(
supply => supply.productGroup === APNEA,
Function IntroductionPage
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IntroductionPage = props => {
useEffect(() => {
focusElement('.schemaform-title > h1');
scrollToTop();
document.title =
Function FacilitySearch
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const FacilitySearch = props => {
const { data: formData, goBack, goForward, goToPath } = props;
const [query, setQuery] = useState('');
const [submittedQuery, setSubmittedQuery] = useState('');
const [loading, setLoading] = useState(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 SpouseEmploymentWorkDates
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const SpouseEmploymentWorkDates = props => {
const { goToPath, setFormData, data } = props;
const RETURN_PATH = '/enhanced-spouse-employment-records';
- 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 EmploymentWorkDates
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const EmploymentWorkDates = props => {
const { goToPath, setFormData, data } = props;
const RETURN_PATH = '/enhanced-employment-records';
- 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 transformVAOSAppointment
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export function transformVAOSAppointment(appt) {
const appointmentType = getAppointmentType(appt);
const isCC = appt.kind === 'cc';
const isVideo = appt.kind === 'telehealth';
const isAtlas = !!appt.telehealth?.atlas;
- 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
File utils.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Template utils.
*/
import { unset } from 'lodash';
import registerFonts from '../registerFonts';
File index.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
import path from 'path';
import get from 'platform/utilities/data/get';
import disableFTUXModals from 'platform/user/tests/disableFTUXModals';
File touData.jsx
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
export default [
{