Showing 3,724 of 12,675 total issues
Function startApp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function startApp({
routes,
createRoutesWithStore,
component,
reducer,
- 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 VaSelectField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function VaSelectField(props) {
let addDefaultEntry = false;
const mappedProps = vaSelectFieldMapping(props);
const enumOptions =
(Array.isArray(props.childrenProps.schema.enum) &&
- 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 UNSAFE_componentWillReceiveProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
UNSAFE_componentWillReceiveProps(newProps) {
const loginAttemptCompleted =
this.props.showLoginModal === true &&
newProps.showLoginModal === false &&
this.loginAttemptInProgress;
- 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 vaTextareaFieldMapping
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function vaTextareaFieldMapping(props) {
const {
description,
textDescription,
DescriptionField,
- 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 currentOrPastDateRangeUI
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const currentOrPastDateRangeUI = (fromOptions, toOptions, errorMessage) => {
let fromLabel = 'From date';
let toLabel = 'To date';
let fromCustomOptions = {};
let toCustomOptions = {};
- 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 profileContactInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const profileContactInfo = ({
content = getContent('application'),
contactPath = CONTACT_INFO_PATH,
addressSchema,
- 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 clone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function clone(object) {
/* eslint-disable no-prototype-builtins */
if (typeof object === 'object') {
if (Array.isArray(object)) {
return object.slice();
- 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 startReactApp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function startReactApp(
component,
root = document.getElementById('react-root'),
) {
// Detect if this is a child frame. If yes, initialize the react devtools hook to work around
- 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 StringField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function StringField(props) {
const { registry, schema, uiSchema, formData } = props;
const uiOptions = getUiOptions(uiSchema);
const labels = uiOptions.labels || {};
const enumOptions = Array.isArray(schema.enum) && optionsList(schema);
- 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 SelectWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function SelectWidget({
schema,
id,
options,
value,
- 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 countOverlapWords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function countOverlapWords(userInput, dropdownTerm, splitreg = REGEX_SPLIT) {
const splitInput = stripCommonWords(userInput).split(splitreg);
const splitOption = stripCommonWords(dropdownTerm).split(splitreg);
const tempOverlapList = [];
for (let i = 0; i < splitInput.length; i += 1) {
- 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 schema
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const schema = optionalFields => {
const s = {
type: 'object',
properties: {
bankAccount: {
- 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 maxItemsHint
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const maxItemsHint = ({
arrayData,
nounSingular,
nounPlural,
maxItems,
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(props) {
super(props);
// In contrast to the normal array field, we don’t want to add an empty item
// and always show at least one item on the review page
const arrayData = (Array.isArray(props.arrayData) && props.arrayData) || [];
- 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 RadioWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function RadioWidget({
options,
value,
disabled,
onChange,
- 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 formatDayMonth
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function formatDayMonth(val) {
if (val) {
const dayOrMonth = val.toString();
if (Number(dayOrMonth) && dayOrMonth.length === 1) {
return `0${val}`;
- 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 determineYesNoField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function determineYesNoField(uiSchema) {
let yesNoKey;
if (uiSchema) {
for (const key of Object.keys(uiSchema)) {
if (
- 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 numberToWords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function numberToWords(value) {
const string = value?.toString();
const number = parseFloat(string);
if (
- 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 evaluateOneOfChoices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const evaluateOneOfChoices = (oneOfChoices, formResponses) => {
for (const choice of Object.keys(oneOfChoices)) {
if (
Array.isArray(oneOfChoices[choice]) &&
validateMultiCheckboxResponses(
- 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 createExternalApplicationUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const createExternalApplicationUrl = () => {
const { application, to } = getQueryParams();
if (!application) {
return null;
}
- 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"