Showing 4,177 of 14,709 total issues
Function ReplyDraftItem
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
Open
const ReplyDraftItem = props => {
const {
draft,
drafts,
cannotReply,
- 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 uiSchema
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function uiSchema(
label = 'Address',
useStreet2 = true,
useStreet3 = false,
isRequired = null,
Function transform
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function transform(formConfig, form) {
// Grab isBDD before things are changed/deleted
const isBDDForm = isBDD(form.data);
// Grab ratedDisabilities before they're deleted in case the page is inactive
// We need to send all of these to vets-api even if the veteran doesn't apply
File validation.js
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import find from 'lodash/find';
import { Validator } from 'jsonschema';
import get from '../../../utilities/data/get';
import omit from '../../../utilities/data/omit';
import set from '../../../utilities/data/set';
File index.js
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const all = [
{
id: 5621490,
reasonForStudy: null,
radiologist: 'DOE,JOHN',
File ArrayField.jsx
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import {
Function uiSchema
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function uiSchema(
label = 'Address',
useStreet3 = false,
isRequired = null,
ignoreRequired = false,
Function render
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
uiSchema,
errorSchema,
idSchema,
File arrayBuilder.jsx
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-unused-vars */
import { getNextPagePath } from 'platform/forms-system/src/js/routing';
import {
createArrayBuilderItemAddPath,
onNavForwardKeepUrlParams,
File seiActivityJournal.js
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const activityJournal = [
{
activityJournalId: 17698747,
oplock: null,
createdDate: null,
Function render
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div>
<article>
<div role="heading" aria-level="2">
Function NoFormPage
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const NoFormPage = () => {
const [data, setData] = useState({});
const [loading, setLoading] = useState(false);
const loggedIn = useSelector(isLoggedIn);
Function SpouseEmploymentWorkDates
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SpouseEmploymentWorkDates = props => {
const { goToPath, setFormData, data } = props;
const RETURN_PATH = '/enhanced-spouse-employment-records';
Function default
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function(state = INITIAL_STATE, action) {
switch (action.type) {
case CALCULATOR_INPUTS_CHANGED: {
const { field, value } = action;
let convertedValue = value;
- 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 NearByVetCenters
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NearByVetCenters = props => {
const [originalCoordinates, setOriginalCoordinates] = useState([]);
const [fetchedVetCenters, setFetchedVetCenters] = useState([]);
const [nearbyVetCenterDistances, setNearbyVetCenterDistances] = useState(
false,
File reducer.js
has 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { getDefaultFormState } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
import {
updateSchemasAndData,
updateItemsSchema,
} from 'platform/forms-system/src/js/state/helpers';
File App.jsx
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import PropTypes from 'prop-types';
import { VaBreadcrumbs } from '@department-of-veterans-affairs/web-components/react-bindings';
Function ContestableIssues
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ContestableIssues = props => {
const {
id,
options,
formContext = {},
Function EmploymentWorkDates
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EmploymentWorkDates = props => {
const { goToPath, setFormData, data } = props;
const RETURN_PATH = '/enhanced-employment-records';
Function PrimaryAddressWithAutofill
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PrimaryAddressWithAutofill = props => {
const { formContext, formData, idSchema, onChange, schema } = props;
const { reviewMode, submitted } = formContext;
const { properties: schemaProps } = schema;
const { veteranAddress } = useSelector(state => state.form.data);