Showing 172 of 172 total issues
Function render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { showMore } = this.state;
const { result, isProjectedVacancy, fromPostMenu } = this.props;
const pos = result.position || result;
- 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 BidTrackerCardTitle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const BidTrackerCardTitle = ({
title,
positionNumber,
id,
bidStatistics,
- 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 NotificationRow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const NotificationRow = ({ id, message, tags, deleteOne, date, isRead, onCheck, checked,
meta, onNavigateTo }) => {
let link;
let buttonTitle;
let buttonTitle2;
- 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 EditBidSeasons
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const EditBidSeasons = ({
id,
description,
bidSeasonsBeginDate,
bidSeasonsEndDate,
- 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 AIMLegsFormRead
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const AIMLegsFormRead = props => {
const { legs } = props;
const showOverlay = !legs.length;
const [rowHoverNum, setRowHoverNum] = 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 exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (config) {
function isAllowed(headerValue, allowedValues) {
if (!headerValue || !allowedValues) { return false; }
return allowedValues.some((candidate) => {
if (typeof candidate === 'string') {
- 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
Consider simplifying this complex logical expression. Open
if (recId === id && useRecommended && !NPrecIsLoading &&
!NPrecHasErrored && NPsuggestions && clientHasLoaded && clicked) {
this.stringifyParamsAndNavigate(NPsuggestions, history);
}
Function localStorageToggleValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function localStorageToggleValue(key, value, useDispatch = true, onlyDelete = false) {
const existingArray = JSON.parse(localStorage.getItem(key)) || [];
// check if the value matches, either as a string or as a number
let indexOfId = existingArray.indexOf(value);
if (indexOfId <= -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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const hidden = {
display: 'none',
};
const { id, type, submitText, placeholder, inputDisabled,
- 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 Paragraphs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const Paragraphs = (props) => {
const { paragraphs, getCableValue, modCableValue } = props;
// Instead of making a ton of variables for tracking the various input data for all
// paragraphs, I made a data object array that tracks all the important information
- 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 AssignmentNotification
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const AssignmentNotification = (props) => {
const location = props.location?.pathname;
const params = location.split('/');
const viewType = params[2];
const noteType = params[5];
- 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 ResultsPillContainer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ResultsPillContainer = ({ items, onPillClick, isClientsPage }) => {
const [showFilters, setShowFilters] = useState(false);
return (
isClientsPage ?
- 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 BidSteps
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const BidSteps = (props, context) => {
const { bid, collapseOverlay } = props;
const { condensedView } = context;
const bidData = bidClassesFromCurrentStatus(bid).stages || {};
const handshakeRegisterWithAnotherBidder = get(bid, 'position_info.bid_statistics[0].has_handshake_offered')
- 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 getResult
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getResult = (result, path, defaultValue, isRate = false) => {
let value = get(result, path, defaultValue);
if ((/_date|date_|ted/i).test(path) && value !== defaultValue) {
value = formatDate(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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { status, statusIsLoading, statusUpdateIsLoading, statusUpdateHasErrored,
statusHasErrored, id, biddersInShortList } = this.props;
const isLoading = statusIsLoading || statusUpdateIsLoading;
let text = 'Lock';
- 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 PositionDetailsItem
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const PositionDetailsItem = (props) => {
const {
details,
editDescriptionContent,
resetDescriptionEditMessages,
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { position,
favorites,
favoritesTandem,
favoritesPV,
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { positionCount, isLoading } = this.props;
// Round to nearest ten, but only if there are more than 50 positions.
// Subtract the count by 6 to ensure that it will always be rounded down to the nearest 10 (-1)
const shouldRound = positionCount > 50;
- 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 localStorageToggleValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function localStorageToggleValue(key: string, value: any, useDispatch: boolean = true, onlyDelete: boolean = false): void {
const existingArray = JSON.parse(localStorage.getItem(key) ?? '') || [];
// check if the value matches, either as a string or as a number
let indexOfId = existingArray.indexOf(value);
if (indexOfId <= -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 getCustomLocation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getCustomLocation(loc, org) {
if (!loc) return NO_POST;
// DC Post - org ex. GTM/EX/SDD
if (get(loc, 'state') === 'DC') return org || NO_POST;
// Domestic outside of DC - City, State
- 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"