Showing 3,724 of 12,675 total issues
File covidResearchUISchema.js
has 632 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { validateBooleanGroup } from 'platform/forms-system/src/js/validation';
import currentOrPastMonthYearUI from 'platform/forms-system/src/js/definitions/currentOrPastMonthYear';
import MonthYearUI from 'platform/forms-system/src/js/definitions/monthYear';
Function IntroductionPage
has 276 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IntroductionPage = props => {
const { route } = props;
const { formConfig, pageList } = route;
const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
File index.jsx
has 626 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import moment from 'moment';
import { differenceInYears } from 'date-fns';
import * as options from 'platform/static-data/options-for-select';
import {
Function addressUISchema
has 274 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addressUISchema = (
isMilitaryBaseAddress = false,
path,
callback,
) => {
Function FacilitiesMap
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
Open
const FacilitiesMap = props => {
const [map, setMap] = useState(null);
const searchResultTitleRef = useRef(null);
const [isMobile, setIsMobile] = useState(window.innerWidth <= 481);
const [isSearching, setIsSearching] = 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
File form.jsx
has 620 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { merge } from 'lodash';
import get from 'platform/utilities/data/get';
Function render
has 271 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
enableShortWorkflow,
errorSchema,
formContext,
File index.jsx
has 617 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { APP_URLS, LAST_YEAR } from '../../utils/constants';
/** CHAPTER 1: Veteran Information */
export const BirthInfoDescription = (
Function AttachmentsList
has 269 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AttachmentsList = props => {
const {
attachments,
compose,
draftSequence,
File FileField.jsx
has 613 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
import PropTypes from 'prop-types';
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
File FacilitiesMap.jsx
has 613 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useEffect, useRef, useState } from 'react';
import { connect } from 'react-redux';
import appendQuery from 'append-query';
import mapboxgl from 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
Function render
has 267 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
uiSchema,
errorSchema,
idSchema,
File helpers.js
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useEffect, useRef } from 'react';
import moment from 'moment';
import { intersection, matches, merge, uniq } from 'lodash';
import shouldUpdate from 'recompose/shouldUpdate';
import { deepEquals } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
File form.jsx
has 604 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import fullSchemaPreNeed from 'vets-json-schema/dist/40-10007-INTEGRATION-schema.json';
import environment from 'platform/utilities/environment';
File constants.js
has 603 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { useSelector } from 'react-redux';
import { VA_FORM_IDS } from 'platform/forms/constants';
export const PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
Function prefillTransformer
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
Open
export function prefillTransformer(pages, formData, metadata) {
const prefillPersonalInformation = data => {
const newData = _.omit(['personalInformation'], data);
const { personalInformation } = data;
- 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 local-vapsvc.js
has 600 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { uniqueId } from 'lodash';
import * as VAP_SERVICE from '../constants';
export function isVAProfileServiceConfigured() {
return (
Function SettingsPage
has 260 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SettingsPage = () => {
const dispatch = useDispatch();
const fullState = useSelector(state => state);
const isSharing = useSelector(state => state.mr.sharing.isSharing);
Function render
has 259 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { route, loggedIn, formId, isBDDForm, showWizard } = this.props;
const { formConfig, pageList } = route;
const pageTitle = `${getPageTitle(isBDDForm)} ${PAGE_TITLE_SUFFIX}`;
const startText = getStartText(isBDDForm);
Function IntroductionPage
has 259 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IntroductionPage = props => {
const { route } = props;
// WIP: need to keep unit-tests passing with these new selector-hooks
const userLoggedIn = useSelector(state => isLoggedIn(state));
const userIdVerified = useSelector(state => isLOA3(state));