Showing 3,724 of 12,675 total issues
Function transform
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function transform(formConfig, form) {
const expandedPages = expandArrayPages(
createFormPageList(formConfig),
form.data,
);
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { disabilities } = this.state;
const { calculatedRating } = this.state;
const ratings = getRatings(disabilities);
Function ContactInformation
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ContactInformation = () => {
const lastLocation = useLastLocation();
const hasUnsavedEdits = useSelector(
state => state.vapService.hasUnsavedEdits,
Function EkgDetails
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EkgDetails = props => {
const { record, runningUnitTest } = props;
const allowTxtDownloads = useSelector(
state =>
state.featureToggles[
Function content
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
if (
(pdfTxtGenerateStatus.status !== PDF_TXT_GENERATE_STATUS.InProgress ||
allergiesError) &&
(prescription || prescriptionsApiError)
File ConfirmationPage.jsx
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { connect } from 'react-redux';
import scrollToTop from 'platform/utilities/ui/scrollToTop';
import PropTypes from 'prop-types';
File index.js
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Node modules.
import React from 'react';
import PropTypes from 'prop-types';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
// Relative imports.
Function Search
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export const Search = ({ onSearch }) => {
const queryParams = new URLSearchParams(window.location.search);
const defaultSelectedOption = deriveDefaultSelectedOption();
- 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 AppointmentDetails
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const AppointmentDetails = props => {
const { router } = props;
const { t } = useTranslation();
const dispatch = useDispatch();
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 CustomResolutionOptionReview
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const CustomResolutionOptionReview = props => {
const formData = useSelector(state => state.form.data);
const { selectedDebtsAndCopays = [] } = formData;
const currentDebt = selectedDebtsAndCopays[props.pagePerItemIndex];
- 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 EnhancedVehicleRecord
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const EnhancedVehicleRecord = ({ data, goToPath, setFormData }) => {
const { assets } = data;
const { automobiles = [] } = assets;
const searchIndex = 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 getCalculatedBenefits
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
(eligibility, institution, form, derived) => {
const calculatedBenefits = {};
if ([eligibility, institution, form, derived].some(e => !e || isEmpty(e))) {
return calculatedBenefits;
- 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 CautionaryInformation
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export function CautionaryInformation({ institution, showModal }) {
const {
complaints,
schoolClosing,
schoolClosingOn,
- 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 useNotificationSettingsUtils
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export const useNotificationSettingsUtils = () => {
const communicationPreferences = useSelector(
state => state?.communicationPreferences,
);
- 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 NewRecordsIndicator
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const NewRecordsIndicator = ({
refreshState,
extractType,
newRecordsFound,
reloadFunction,
- 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 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { route } = this.props;
const { formConfig, pageList } = route;
return (
<article className="schemaform-intro">
Function Landing
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Landing = props => {
const { router } = props;
const { t } = useTranslation();
const { jumpToPage } = useFormRouting(router);
Function VaMedicalCenter
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VaMedicalCenter = props => {
const { formContext, id, onChange, value, veteranFacilityState } = props;
const { reviewMode, submitted } = formContext;
const [facilities, setFacilities] = useState([]);
Function TopicSelect
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TopicSelect = props => {
const { id, onChange, value, loggedIn, categoryID } = props;
const dispatch = useDispatch();
const [apiData, setApiData] = useState([]);
Function ConfirmApprovedPage
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ConfirmApprovedPage() {
const [confirmedData, setConfirmedData] = useState(0);
// on react component mount, fetch data
useEffect(() => {