Showing 3,724 of 12,675 total issues
Function render
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
value: items,
id,
options,
Function Compose
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Compose = () => {
const dispatch = useDispatch();
const recipients = useSelector(state => state.sm.recipients);
const { drafts, saveError } = useSelector(state => state.sm.threadDetails);
const signature = useSelector(state => state.sm.preferences.signature);
Function DirectDeposit
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DirectDeposit = () => {
const directDepositHookResult = useDirectDeposit();
const {
ui,
Function RadiologyDetails
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const RadiologyDetails = props => {
const { record, fullState, runningUnitTest } = props;
const user = useSelector(state => state.user.profile);
const allowTxtDownloads = useSelector(
state =>
Function prescriptionsReducer
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const prescriptionsReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.Prescriptions.SET_DETAILS:
case Actions.Prescriptions.GET_DETAILS: {
return {
File SearchControls.jsx
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useEffect, useRef, useState } from 'react';
import recordEvent from 'platform/monitoring/record-event';
import { focusElement } from 'platform/utilities/ui';
import classNames from 'classnames';
import {
Function FormStartControls
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FormStartControls = props => {
const {
formId,
migrations,
startPage,
Function WhatToDoNext
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const WhatToDoNext = props => {
const { router, appointments, action, goToDetails } = props;
const selectApp = useMemo(makeSelectApp, []);
const { app } = useSelector(selectApp);
const { t } = useTranslation();
File form.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import FormFooter from 'platform/forms/components/FormFooter';
// import CustomPageWrapper from '../components/CustomPageWrapper';
import IntroductionPage from '../containers/IntroductionPage';
import taskList from '../pages/taskList';
File calculator.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { isFinite } from 'lodash';
import camelCaseKeysRecursive from 'camelcase-keys-recursive';
import {
CALCULATOR_INPUTS_CHANGED,
File labsAndTests.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { parseISO } from 'date-fns';
import { Actions } from '../util/actionTypes';
import {
concatObservationInterpretations,
dateFormatWithoutTimezone,
Function generate
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generate = async data => {
validate(data.details);
const doc = createAccessibleDoc(data, config);
Function ResourcesAndSupportSearchApp
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ResourcesAndSupportSearchApp = () => {
const [articles, errorMessage] = useArticleData();
const [userInput, setUserInput] = useState('');
const [query, setQuery] = useState('');
const [page, setPage] = useState(1);
Function applicantInformationUpdate
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function applicantInformationUpdate(schema, options) {
// Use the defaults as necessary, but override with the options given
const prefix = options && options.isVeteran ? 'veteran' : 'relative';
const { fields, required, labels } = {
...defaults(prefix),
File EvidenceRecords.jsx
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import {
Function ChooseCommunityCare
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ChooseCommunityCare() {
const history = useHistory();
const [providers, setProviders] = useState([
{
Function render
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
const {
value: items,
id,
options,
- 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 ConfirmationPage.jsx
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import moment from 'moment';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import environment from 'platform/utilities/environment';
File ConfirmationPage.jsx
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import moment from 'moment';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import environment from 'platform/utilities/environment';
Function prefillTransformerV1
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function prefillTransformerV1(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
const contactInfo = claimant?.contactInfo || {};