Showing 4,177 of 14,709 total issues
Function ChangeOfAddressWrapper
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
Open
const ChangeOfAddressWrapper = ({ mailingAddress, applicantName }) => {
const { loading: isLoading, error, data: response } = useSelector(
state => state.updateAddress,
);
const {
- 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 SettingsPage
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
Open
const SettingsPage = () => {
const dispatch = useDispatch();
const fullState = useSelector(state => state);
const isSharing = useSelector(state => state.mr.sharing.isSharing);
- 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 render
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { supplies, order, eligibility } = this.props;
const currentDate = moment();
const accessorySupplies = supplies.filter(
supply => supply.productGroup === ACCESSORY,
Function UpcomingAppointmentsPage
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UpcomingAppointmentsPage = props => {
const { router } = props;
const [refresh, setRefresh] = useState(false);
const selectApp = useMemo(makeSelectApp, []);
const { app } = useSelector(selectApp);
Function mapStateToProps
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mapStateToProps(state, ownProps) {
const { formContext } = ownProps;
const loggedIn = isLoggedIn(state);
const { form, askVA } = state;
const formData = form.data;
Function submitFilesLighthouse
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function submitFilesLighthouse(claimId, trackedItem, files) {
let filesComplete = 0;
let bytesComplete = 0;
let hasError = false;
const totalSize = files.reduce((sum, file) => sum + file.file.size, 0);
Function editPhoneNumberSuccess
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const editPhoneNumberSuccess = () => {
// store the phone number that's passed in via the POST or PUT call so we can
// return it with the GET user/ response
let newAreaCode;
let newPhoneNumber;
Function ProgressNoteDetails
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ProgressNoteDetails = props => {
const { record, runningUnitTest } = props;
const user = useSelector(state => state.user.profile);
const allowTxtDownloads = useSelector(
state =>
Function PathologyDetails
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PathologyDetails = props => {
const { record, fullState, runningUnitTest } = props;
const user = useSelector(state => state.user.profile);
const allowTxtDownloads = useSelector(
state =>
File dependentChildrenPages.js
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import merge from 'lodash/merge';
import get from 'platform/utilities/data/get';
import {
arrayBuilderItemFirstPageTitleUI,
Function render
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
route,
params,
form,
Function generateFeatureToggles
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generateFeatureToggles = (toggles = {}) => {
const {
mhvLandingPagePersonalization = true,
mhvMedicationsToVaGovRelease = true,
mhvMedicationsDisplayRefillContent = true,
Function DependentInformation
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DependentInformation = props => {
const { data, goToPath, setFormData } = props;
const { dependents = [] } = data;
const search = new URLSearchParams(window.location.search);
Function DependentInformation
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DependentInformation = props => {
const { data, goToPath, setFormData } = props;
const { dependents = [] } = data;
const search = new URLSearchParams(window.location.search);
Function render
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { route, userIdVerified, userLoggedIn } = this.props;
const { formConfig, pageList } = route;
return (
Function EmploymentQuestion
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EmploymentQuestion = props => {
const {
data,
goBack,
goToPath,
Function MessageThreadItem
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MessageThreadItem = props => {
const dispatch = useDispatch();
const accordionItemRef = useRef();
const { message, isDraftThread, open, forPrint } = props;
const {
File index.unit.spec.js
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable camelcase */
import React from 'react';
import { Route } from 'react-router-dom';
import { expect } from 'chai';
import { fireEvent, waitFor } from '@testing-library/dom';
File constants.js
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable camelcase */
/* eslint-disable no-restricted-syntax */
export const PAGE_TITLE = 'GI Bill® CT Redesign Sandbox';
File index.js
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Node modules.
import React from 'react';
import PropTypes from 'prop-types';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
// Relative imports.