Showing 3,724 of 12,675 total issues
Function SpousePayrollDeductionInputList
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const SpousePayrollDeductionInputList = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
- 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 ReviewCardField
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const ReviewCardField = ({
uiSchema,
schema,
errorSchema,
idSchema,
- 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 AttachmentsList
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const AttachmentsList = props => {
const {
attachments,
compose,
draftSequence,
- 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 formatDescription
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export function formatDescription(description, location = '') {
if (!description || !description.text) {
return 'DESCRIPTION:';
}
- 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 ComparePage.jsx
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useEffect,
useRef,
useState,
useCallback,
File index.jsx
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable react/sort-prop-types */
/* eslint-disable react/static-property-placement */
// Dependencies.
import React, { Component } from 'react';
import {
Function render
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { route } = this.props;
const { formConfig, pageList } = route;
return (
Function FileFieldCustom
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FileFieldCustom(props) {
const updateButton = (
// eslint-disable-next-line @department-of-veterans-affairs/prefer-button-component
<button type="submit" onClick={props.updatePage}>
Update page
Function renderResultsSection
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderResultsSection = () => {
const {
currentQuery,
searchResults,
pagination,
Function useFormRouting
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useFormRouting = (router = {}) => {
const selectForm = useMemo(makeSelectForm, []);
const { pages, data } = useSelector(selectForm);
const selectApp = useMemo(makeSelectApp, []);
Function usePostTravelOnlyClaim
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
const usePostTravelOnlyClaim = props => {
const { router } = props;
const { jumpToPage } = useFormRouting(router);
const [isLoading, setIsLoading] = useState(false);
const [isComplete, setIsComplete] = useState(false);
Function fieldEntries
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fieldEntries = (key, uiSchema, data, schema, schemaFromState) => {
if (key.startsWith('view:') || key.startsWith('ui:')) return null;
if (schema.properties[key] === undefined || !uiSchema) return null;
const {
File actions.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Sentry from '@sentry/browser';
import recordEvent from '../../monitoring/record-event';
import { logOut } from '../../user/authentication/actions';
import { apiRequest } from '../../utilities/api';
Function OfficialGovtWebsite
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const OfficialGovtWebsite = () => {
const [expanded, setExpanded] = useState(false);
const onToggle = () => {
if (expanded) {
File RoutedSavableApp.jsx
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import Scroll from 'react-scroll';
import { withRouter } from 'react-router';
import { connect } from 'react-redux';
Function AdditionalConsiderationTemplate
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AdditionalConsiderationTemplate(page, formField, options = {}) {
const { title, additionalInfo } = page;
const additionalInfoViewName = `view:${page.name}AdditionalInfo`;
const displayTypeMapping = {
[formFields.federallySponsoredAcademy]: 'Academy',
Function onAddFile
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onAddFile = async (event, index = null, password) => {
if (event.target?.files?.length) {
const currentFile = event.target.files[0];
const allFiles = props.formData || [];
const addUiOptions = props.uiSchema['ui:options'];
Function render
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { form } = this.props;
const { submission, data } = form;
const submitDate = new Date(submission?.timestamp);
Function onAddFile
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onAddFile = async (event, index = null, password) => {
if (event.target?.files?.length) {
const currentFile = event.target.files[0];
const allFiles = props.formData || [];
const addUiOptions = props.uiSchema['ui:options'];
Function ApplicationDownloadLink
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ApplicationDownloadLink = () => {
const [loading, isLoading] = useState(false);
const [errors, setErrors] = useState([]);
// define local use variables