Showing 4,177 of 14,709 total issues
File helpers.js
has 551 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { snakeCase } from 'lodash';
import URLSearchParams from 'url-search-params';
import { useLocation } from 'react-router-dom';
import constants from 'vets-json-schema/dist/constants.json';
Function MoveMessageToFolderBtn
has 229 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MoveMessageToFolderBtn = props => {
const {
threadId,
allFolders,
isVisible,
File actions.js
has 545 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-prototype-builtins */
import moment from 'moment';
import * as Sentry from '@sentry/browser';
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import {
Function AllergyDetails
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AllergyDetails = props => {
const { runningUnitTest } = props;
const dispatch = useDispatch();
const allergy = useSelector(state => state.mr.allergies.allergyDetails);
const allergyList = useSelector(state => state.mr.allergies.allergiesList);
File constants.js
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
export const envUrl = environment.API_URL;
export const baseURL = '/ask_va_api/v0';
Function ConfirmationPageV2
has 226 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ConfirmationPageV2 = () => {
const alertRef = useRef(null);
const form = useSelector(state => state.form || {});
const profile = useSelector(state => selectProfile(state));
File PhoneLayout.unit.spec.js
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { expect } from 'chai';
import moment from 'moment';
import {
createTestStore,
Function render
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
currentPageNumber,
errorMessages,
facilityCodeSelected,
File index.js
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const defaultUser = {
data: {
id: '',
type: 'user',
attributes: {
Function formReducer
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function formReducer(state = initialState, action) {
switch (action.type) {
case FORM_PAGE_OPENED: {
const { data, schema } = setupFormData(
state.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 helpers.js
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { dropRight, merge } from 'lodash';
import { getDefaultFormState } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
import dataGet from '../../../../utilities/data/get';
import set from '../../../../utilities/data/set';
import unset from '../../../../utilities/data/unset';
File SearchPage.jsx
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable react-hooks/exhaustive-deps */
import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { connect, useStore } from 'react-redux';
Function debtSummaryText
has 221 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const debtSummaryText = (diaryCode, dateOfLetter, balance) => {
const endDateText = endDate(dateOfLetter, diaryCode);
switch (diaryCode) {
case '71':
Function EmploymentRecord
has 220 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EmploymentRecord = props => {
const { data, goToPath, setFormData } = props;
const editIndex = getJobIndex();
Function EmploymentRecord
has 220 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EmploymentRecord = props => {
const { data, goToPath, setFormData } = props;
const editIndex = getJobIndex();
File form-submit-transform.js
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// this constant maps the values on address.js in vets.json schema from VA.gov values to LTS values
import { formFields } from '../constants';
// the lts values were found on the LTS database and LTS validates them, so we need to send correct value from here
File FilterYourResults.jsx
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useState, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import { connect } from 'react-redux';
import _ from 'lodash';
import recordEvent from 'platform/monitoring/record-event';
File applicantFileUpload.js
has 530 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { titleUI } from 'platform/forms-system/src/js/web-component-patterns';
import { fileUploadBlurbCustom } from 'applications/ivc-champva/shared/components/fileUploads/attachments';
import { applicantWording } from '../../../shared/utilities';
import ApplicantField from '../../../shared/components/applicantLists/ApplicantField';
Function ManageFolderButtons
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ManageFolderButtons = props => {
const { ErrorMessages, Alerts } = Constants;
const dispatch = useDispatch();
const history = useHistory();
const { folder } = props;
File ClaimExamLayout.unit.spec.js
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { expect } from 'chai';
import moment from 'moment';
import {
createTestStore,