Showing 108 of 518 total issues
Function updateAuthUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default async function updateAuthUser(user: User): Promise<User> {
await user.validatePhone();
const [err, userRecord] = await to<UserRecord, FirebaseError>(
auth.updateUser(user.id, {
disabled: 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"
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"
Further reading
Function ResultsList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function ResultsList({
query,
searching,
setSearching,
setHits,
- 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 getRecurString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getRecurString(rrule?: string, locale = 'en'): string {
let recur = '';
if (!rrule) return recur;
if (rrule.includes('FREQ=DAILY')) {
recur = 'Daily';
- 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 PhotoInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function PhotoInput({
value,
onChange,
required,
...textFieldProps
- 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 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 UserDisplayPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function UserDisplayPage({
org,
user: fallbackData,
langs: initialLangs,
subjects: initialSubjects,
- 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"