Showing 4,177 of 14,709 total issues
Function navigateForward
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
Open
export const navigateForward = (
SHORT_NAME,
formResponses,
router,
editMode,
- 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 V3BasePage.jsx
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* This page is for testing the compatibility of running v3 components without Formation styling.
*/
import React, { useState } from 'react';
Function render
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
formIds,
profile,
login,
Function schoolSearch
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function schoolSearch(state = initialState, action) {
switch (action.type) {
case INSTITUTION_SELECTED: {
const {
address1,
File SaveInProgressIntro.jsx
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import PropTypes from 'prop-types';
import { fromUnixTime, isBefore } from 'date-fns';
File SchoolSelectField.jsx
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
import classNames from 'classnames';
import {
Function Error
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Error = () => {
const { t } = useTranslation();
const selectError = useMemo(makeSelectError, []);
const { error } = useSelector(selectError);
Function SpousePayrollDeductionInputList
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SpousePayrollDeductionInputList = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
File SaveInProgressIntro.jsx
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import PropTypes from 'prop-types';
import { fromUnixTime, isBefore } from 'date-fns';
Function FilterBeforeResults
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
Open
export function FilterBeforeResults({
dispatchFilterChange,
dispatchError,
filters,
modalClose,
- 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 SaveInProgressIntro.jsx
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import PropTypes from 'prop-types';
import { fromUnixTime, isBefore } from 'date-fns';
Function render
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { onCTALinkClick } = this;
const {
ehrDataByVhaId,
cernerFacilities,
Function SmBreadcrumbs
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SmBreadcrumbs = () => {
const dispatch = useDispatch();
const location = useLocation();
const history = useHistory();
const activeFolder = useSelector(state => state.sm.folders.folder);
File constants.js
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { getAppUrl } from '../utilities/registry-helpers';
export const VA_FORM_IDS = Object.freeze({
FEEDBACK_TOOL: 'FEEDBACK-TOOL',
FORM_0873: '0873',
Function DevPanel
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DevPanel = () => {
const [processes, setProcesses] = useState({});
const [output, setOutput] = useState({});
const eventSourcesRef = useRef({});
File ReviewPage.jsx
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
VaAccordion,
VaAccordionItem,
VaAlert,
} from '@department-of-veterans-affairs/component-library/dist/react-bindings';
Function PayrollDeductionInputList
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PayrollDeductionInputList = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
Function NationalExamsList
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NationalExamsList = () => {
const dispatch = useDispatch();
const [currentPage, setCurrentPage] = useState(1);
const itemsPerPage = 5;
const { loading, error, nationalExams } = useSelector(
File SaveInProgressIntro.jsx
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import PropTypes from 'prop-types';
import { fromUnixTime, isBefore } from 'date-fns';
Function template
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const template = (props, title, content, submissionMessage, messageType) => {
const { fullName, disabilities, submittedAt, isSubmittingBDD } = props;
const { first, last, middle, suffix } = fullName;
// This is easier than passing down props and checking if the form type
const pageTitle = document.title.includes('Benefits')