Showing 250 of 735 total issues
Function middleware
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const middleware: Middleware = () => {
const activeToasts = new Map<string, ActiveToast[]>();
const addToastHandler = (info: ActiveToast) => {
const list = activeToasts.get(info.actionType) ?? [];
- 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 DetailedStatus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function DetailedStatus({ enableError }: Props) {
const { t } = useTranslation();
const mics = useSelectorFactory(selectAvailableInputDevicesFactory, (state: RootState, selector) =>
selector(state, 'mic'),
- 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 createTransport
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public async createTransport(
{ sctpCapabilities, forceTcp, producing, consuming }: CreateTransportRequest,
connectionId: string,
): Promise<SuccessOrError<CreateTransportResponse>> {
const connection = this.connections.get(connectionId);
- 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 onObjectRemoved
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private onObjectRemoved(e: IEvent) {
if (!e.target) return;
const deletionId = (e.target as any).deletionId;
if (deletionId) {
- 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 PollCard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function PollCard({ poll: viewModel }: Props) {
const { poll } = viewModel;
const classes = useStyles();
const dispatch = useDispatch();
const { t } = useTranslation();
- 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 ChatMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ChatMessage({ message, participantColors }: Props) {
const classes = useStyles();
const isEmoji = message && message.message.length <= 8 && onlyEmojisRegex.test(message.message);
const sender = useSelector((state: RootState) => selectParticipant(state, message?.sender?.participantId));
- 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 ParticipantContextMenu
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ParticipantContextMenu = React.forwardRef<HTMLElement, Props>(({ participant, onClose }, _) => {
const dispatch = useDispatch();
const classes = useStyles();
const { t } = useTranslation();
- 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 ChatMessageList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ChatMessageList({ messages, participantId, participantColors, error, onRetry }: Props) {
const classes = useStyles();
const { t } = useTranslation();
const listRef = useRef<HTMLOListElement>(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"
Further reading
Function validateNumber
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const validateNumber = (n: number | undefined, instruction: NumericInstruction) => {
if (n === undefined) {
return { valid: false, error: 'conference.poll.types.numeric.error_invalid_number' };
}
- 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 BreakoutRoomsPopper
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function BreakoutRoomsPopper(props: ListItemPopperProps) {
const dispatch = useDispatch();
const { t } = useTranslation();
const classes = useStyles();
- 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
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return 'ok';
Avoid too many return
statements within this function. Open
return (
<div>
<Grid container spacing={2}>
<Grid item>
<StatusChip
Avoid too many return
statements within this function. Open
return health.connection.receiveTransport.transportState;
Avoid too many return
statements within this function. Open
return 'Connection not found'; // should not happen
Avoid too many return
statements within this function. Open
return { valid: false, error: 'conference.poll.types.numeric.error_not_match_step' };
Avoid too many return
statements within this function. Open
if (source === 'loopback-webcam' && kind === 'video') return true;
Avoid too many return
statements within this function. Open
return <RequestUserInteractionView />;
Avoid too many return
statements within this function. Open
return { success: true, response: { id: producer.id } };
Avoid too many return
statements within this function. Open
return t(`${webRtcNamespace}.transport_${health.connection.receiveTransport.transportState}.message`, {
transport: 'receive-transport',
});