Showing 3,724 of 12,675 total issues
File VaPrescription.jsx
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';
Function render
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { form } = this.props;
const { name } = form.data.application.claimant;
const submittedAt = moment(form.submission.submittedAt);
Function ThreadsList
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ThreadsList = props => {
const {
folder,
threadList,
keyword,
Function ViewDependentsListItem
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ViewDependentsListItem(props) {
const [open, setOpen] = useState(false);
const {
manageDependentsToggle,
File index.js
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import moment from 'moment-timezone';
import { isArray, sortBy, filter, isEmpty } from 'lodash';
export const filterByOptions = [
{
Function ContactInfo
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
const ContactInfo = ({
data,
goBack,
goForward,
onReviewPage,
- 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 ContestableIssues
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
const ContestableIssues = props => {
const {
id,
options,
formContext = {},
- 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 updateSchema
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateSchema = () => {
if (addressFormData) {
// if livesOnMilitaryBase is checked
if (addressFormData?.['view:livesOnMilitaryBase']) {
const filteredRequiredArray = addressFormRequiredData.filter(
Function TravelIntro
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TravelIntro = props => {
const { router } = props;
const { t } = useTranslation();
const { goToNextPage } = useFormRouting(router);
Function content
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const content = () => {
const status = prescription?.dispStatus?.toString();
return (
<div className="medication-details-div vads-u-border-top--1px vads-u-border-color--gray-lighter vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--3">
<h2 className="vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--2 no-print">
File index.js
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const all = {
resourceType: 'Bundle',
id: '12121',
meta: {
lastUpdated: '2023-09-29T11:04:31.316-04:00',
File form.js
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import commonDefinitions from 'vets-json-schema/dist/definitions.json';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import profileContactInfo from 'platform/forms-system/src/js/definitions/profileContactInfo';
import configService from '../utilities/configService';
import manifest from '../manifest.json';
Function MobileLinks
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function MobileLinks(props) {
const { links, visible, langConfig, minimalFooter } = props;
return (
<div
Function FormSaved
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FormSaved = props => {
const {
router,
route,
lastSavedDate,
Function exports
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async (on, config) => {
if (process.env.CODE_COVERAGE === 'true') {
require('@cypress/code-coverage/task')(on, config);
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'));
}
Function transform
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function transform(formConfig, form) {
const usFormTransform = () =>
JSON.parse(transformForSubmit(formConfig, form));
const prefillTransforms = formData => {
Function Avs
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Avs = props => {
useDatadogRum();
const user = useSelector(selectUser);
const { avsEnabled, featureTogglesLoading } = useSelector(
Function Landing
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Landing = props => {
const { location, router } = props;
const { jumpToPage } = useFormRouting(router);
const { t } = useTranslation();
File TravelPayStatusApp.jsx
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import {
isProfileLoading,
isLoggedIn,
Function render
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
loadingDecisionRequest,
decisionRequestError,
params,