Showing 3,724 of 12,675 total issues
Function renderYourMilitaryDetails
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderYourMilitaryDetails = () => {
const chapter33Check = giBillChapter === '33a' || giBillChapter === '33b';
/*
***toggleCumulativeDropDown***
Hide Cumulative Post 9/11 active-duty service drop down if applicant selects 'Fry Scholarship'
Function render
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div
className="schemaform-intro"
itemScope
Function VaMedicalCenter
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VaMedicalCenter = props => {
const {
errorSchema,
formContext,
formData,
File FilterYourResults.jsx
has 465 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useState } from 'react';
import { useHistory } from 'react-router-dom';
import { connect } from 'react-redux';
import _ from 'lodash';
import recordEvent from 'platform/monitoring/record-event';
File App.jsx
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useEffect, useState } 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';
File ArrayField.jsx
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React from 'react';
import set from 'platform/utilities/data/set';
import classNames from 'classnames';
import Scroll from 'react-scroll';
Function transformVAOSAppointment
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function transformVAOSAppointment(appt) {
const appointmentType = getAppointmentType(appt);
const isCC = appt.kind === 'cc';
const isVideo = appt.kind === 'telehealth';
const isAtlas = !!appt.telehealth?.atlas;
Function CompareLayout
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
Open
const CompareLayout = ({
calculated,
estimated,
institutions,
showDifferences,
- 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 getEventContent
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getEventContent(event) {
switch (event.type) {
case EVENT_TYPES.claimDecision:
return {
title: 'VA sent you a claim decision',
File form.js
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import get from 'platform/utilities/data/get';
import manifest from '../manifest.json';
Function AppointmentListItem
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AppointmentListItem = props => {
const { appointment, goToDetails, router, app, page, count } = props;
const { t } = useTranslation();
const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
const { isMedicationReviewContentEnabled } = useSelector(
Function PreSubmitSection
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function PreSubmitSection(props) {
const {
form,
preSubmit = {},
setPreSubmit,
Function render
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { schema, uiSchema, path, pageTitle, formContext } = this.props;
const uiOptions = uiSchema['ui:options'] || {};
const fieldName = path[path.length - 1];
Function render
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { schema, uiSchema, path, pageTitle, formContext } = this.props;
const uiOptions = uiSchema['ui:options'] || {};
const fieldName = path[path.length - 1];
File newAppointmentFlow.js
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import {
selectFeatureBreadcrumbUrlUpdate,
selectRegisteredCernerFacilityIds,
} from '../redux/selectors';
File EducationWizard.jsx
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// disabled for unit testing to work
/* eslint-disable no-restricted-syntax */
/* eslint-disable guard-for-in */
import React from 'react';
Function SmBreadcrumbs
has 174 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);
Function render
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { route, user } = this.props;
return (
<div className="schemaform-intro">
Function Error
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Error = () => {
const selectError = useMemo(makeSelectError, []);
const { error } = useSelector(selectError);
const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
// appt link will be /my-health/appointments if toggle is on
Function generateResultsMedicationListContent
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
Open
const generateResultsMedicationListContent = async (
medication,
doc,
results,
hasHorizontalRule,
- 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"