Showing 507 of 518 total issues
Function getPerson
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default async function getPerson(
{ id, roles, name }: Partial<User> & { id: string },
people: User[] = []
): Promise<User> {
if (!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 DialogContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function DialogContent({
page,
children,
forceMinHeight,
}: DialogContentProps): JSX.Element {
- 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 remind
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default async function remind(req: Req, res: Res): Promise<void> {
if (req.method !== 'GET') {
res.setHeader('Allow', ['GET']);
res.status(405).end(`Method ${req.method as string} Not Allowed`);
} else {
- 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 getMeetingVenue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function getMeetingVenue(
meeting: Meeting,
org: Org,
people: User[]
): 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
Function sendLoginLink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function sendLoginLink(req: Req, res: Res<void>): Promise<void> {
if (!isJSON(req.body)) throw new APIError('Invalid request body', 400);
if (typeof req.body.email !== 'string')
throw new APIError('Request body must contain an email', 400);
if (typeof req.body.location !== '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
Function Card
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function Card<T extends Record<string, number> & { week: number }>({
data,
title,
children,
header,
- 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 UserEdit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function UserEdit({
user: fallbackData,
}: UserEditProps): JSX.Element {
const updateLocal = useCallback(async (updated: User) => {
await mutate(`/api/users/${updated.id}`, updated.toJSON(), false);
- 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"