Showing 172 of 172 total issues
Function render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { expanded: expandedState } = this.state;
const { id, title, children, className, controlled, expanded: expandedProp, useIdClass,
buttonClass, childClass, preContent, disabled } = this.props;
const formattedId = formatIdSpacing(id);
- 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 CreateJobCategoryModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const CreateJobCategoryModal = (props) => {
const { dispatch, refSkills } = props;
const [selectedSkillIds, setSelectedSkillIds] = useState([]);
const [newCategoryName, setNewCategoryName] = useState('');
- 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 SavedSearches
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SavedSearches = props => {
const [selected, setSelected] = useState('all');
const {
savedSearches,
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { term, isNewTerm, hasErrored, submitGlossaryTerm } = this.props;
const { editorHidden } = this.state;
const { renderedTitle, renderedLink, renderedDefinition } = this.getTextToRender();
- 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 Definition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Definition = (props) => {
const options = omit(props, keys(defaults));
let { term, definition } = props;
const { excludeColon } = props;
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
// is the bid currently saved?
// save value and avoid interrogating the array more than once
const { isSaved, canDelete } = this.getBidData();
const { isClient } = this.context;
- 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 BidCount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const BidCount = ({ bidStatistics, hideLabel, label, altStyle, isCondensed, isTandemTwo }) => {
let labelClass = 'bid-count-label';
if (hideLabel) { labelClass = `${labelClass} usa-sr-only`; }
const bidStatistics$ = bidStatistics || {};
return (
- 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 AIMLegsFormEdit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AIMLegsFormEdit = props => {
const {
efPos,
legs,
onClose,
- 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 ToggleButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ToggleButton = props => {
const { labelTextLeft, labelTextRight, labelSameLine, checked,
onChange, height, width, onColor, offColor, checkedIcon, uncheckedIcon,
onHandleColor, offHandleColor, boxShadow, activeBoxShadow } = props;
- 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 getAvatarColor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getAvatarColor = (str: string, hashAdjuster: number = 0): { backgroundColor: string, color: 'black' | 'white' } | null => {
if (str) {
let hash: number = Math.floor(Math.random() * hashAdjuster);
//replaced this loop with the for loop below
- 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 filterAPFilters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const filterAPFilters = (data) => {
const filters$ = data.filters.map((m) => {
const hasAPEndpoint = has(m, 'item.endpointAP');
const hasAltData = has(m, 'item.dataAP');
const hasAPRef = has(m, 'item.selectionRefAP');
- 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 mapDuplicates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const mapDuplicates = (
data: any[] = [],
propToCheck: string = 'custom_description',
transformFunc?: (item: any) => any
): any[] => {
- 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"