Showing 108 of 518 total issues
Function isMeetingJSON
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function isMeetingJSON(json: unknown): json is MeetingJSON {
if (!isResourceJSON(json)) return false;
if (!isJSON(json)) return false;
if (typeof json.id !== 'number') return false;
if (!isArray(json.tags, isMeetingTag)) return 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 SubjectSelect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function SubjectSelect({
value,
onChange,
selected,
onSelectedChange,
- 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 updateAccount
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async function updateAccount(req: Req, res: Res): Promise<void> {
const body = verifyBody<User, UserJSON>(req.body, isUserJSON, User);
// Revert to old behavior if user doesn't already exist; just create it.
const original = (await to(getUser(body.id)))[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 useClickOutside
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function useClickOutside(
onClickOutside: () => void,
active: boolean
): ClickOutsideProps {
const clickableEls = useRef<Record<string, HTMLElement>>({});
- 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 WeeklyDisplay
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function WeeklyDisplay({
searching,
meetings,
filtersOpen,
width: cellWidth,
- 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 useContinuous
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function useContinuous<T>(
fallbackData: T,
updateRemote: (data: T) => Promise<T | void>,
updateLocal?: (data: T, hasBeenUpdated?: boolean) => Promise<void> | void
): ContinuousProps<T> {
- 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 verifyAuth
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default async function verifyAuth(
headers: IncomingHttpHeaders,
options?: { userId?: string; userIds?: string[]; orgIds?: string[] }
): Promise<{ adminOf?: string[]; uid: string }> {
if (typeof headers.cookie !== '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 isOrgJSON
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function isOrgJSON(json: unknown): json is OrgJSON {
if (!isAccountJSON(json)) return false;
if (!isJSON(json)) return false;
if (!isStringArray(json.members)) return false;
if (!isStringArray(json.domains)) return 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 getUsers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export async function getUsers(
query: UsersQuery
): Promise<{ hits: number; results: User[] }> {
// TODO: Order by multiple attributes to show featured results first.
let select = query.met
- 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 MeetingRnd
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function MeetingRnd({
now,
width,
eventTarget,
eventData,
- 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 updateMeetingAPI
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default async function updateMeetingAPI(
req: Req,
res: Res<UpdateMeetingRes>
): Promise<void> {
try {
- 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 CalendarHeader
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function CalendarHeader({ query, setQuery }: CalendarHeaderProps): JSX.Element {
const { org } = useOrg();
const { t, lang: locale } = useTranslation();
const title = useMemo(() => {
- 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 AuthDialog
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function AuthDialog(): JSX.Element {
const [loggingIn, setLoggingIn] = useState<boolean>(false);
const [error, setError] = useState<string>('');
const { org } = useOrg();
- 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 isTimeslotJSON
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function isTimeslotJSON(json: unknown): json is TimeslotJSON {
if (!isJSON(json)) return false;
if (typeof json.id !== 'string') return false;
if (!isDateJSON(json.from)) return false;
if (!isDateJSON(json.to)) return 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 Login
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function Login(): JSX.Element {
const { query } = useRouter();
const { t } = useTranslation();
const [error, setError] = useState<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 UserSelect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function UserSelect({
query,
value,
onChange,
selected,
- 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 getDate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
weekday: number,
hours: number,
minutes = 0,
seconds = 0,
milliseconds = 0,
Function Home
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function Home({ org }: HomeProps): JSX.Element {
const { t, lang: locale } = useTranslation();
return (
<div data-cy='org-home' className={cn({ [styles.loading]: !org })}>
- 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 SearchPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function SearchPage(props: PageProps): JSX.Element {
usePage('Search');
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 MeetingItem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function MeetingItem({
now,
meeting,
leftPercent,
widthPercent,
- 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"