Showing 108 of 518 total issues
Function RequestForm
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
export default function RequestForm({
user: volunteer,
}: RequestFormProps): JSX.Element {
const [loading, setLoading] = useState<boolean>(false);
const [checked, setChecked] = useState<boolean>(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 plugins
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
export default function plugins(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Cypress.ConfigOptions {
codecov(on, config);
- 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 Calendar
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
export default function Calendar({
org: byOrg,
user: byUser,
}: CalendarProps): JSX.Element {
const [filtersOpen, setFiltersOpen] = useState<boolean>(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 AvailabilitySelect
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function AvailabilitySelect({
value,
onChange,
renderToPortal,
focused,
- 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 Select
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export default function Select<T, O extends Option<T>>({
value,
onChange,
getSuggestions,
forceUpdateSuggestions = 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 MeetingContent
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
(
{ meeting, height, eventTarget, eventData }: MeetingContentProps,
ref: Ref<HTMLElement>
): JSX.Element => {
const { lang: locale } = 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 App
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export default function App({ Component, pageProps }: AppProps): JSX.Element {
// The user account state must be defined as a hook here. Otherwise, it gets
// reset during client-side page navigation.
const userLoaded = useRef<boolean>(false);
const { data, error } = useSWR<UserJSON, APIError>('/api/account', fetcher);
- 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 Signup
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export default function Signup(): JSX.Element {
const track = useTrack();
const updateRemote = useCallback(
async (updated: User) => {
- 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 DialogSurface
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export default function DialogSurface({
width: rndWidth,
offset,
children,
}: DialogSurfaceProps): 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 analyticsAPI
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export default async function analyticsAPI(
req: Req,
res: Res<AnalyticsRes | APIError>
): Promise<void> {
if (req.method !== 'GET') {
- 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 useSingle
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function useSingle<T>(
fallbackData: T,
updateRemote: (data: T) => Promise<T | void>,
updateLocal?: (
data: 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 toString
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public toString(
locale = 'en',
timeZone = 'America/Los_Angeles',
showTimeZone = true,
showTimeOnly = 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 isUserJSON
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function isUserJSON(json: unknown): json is UserJSON {
if (!isAccountJSON(json)) return false;
if (!isJSON(json)) return false;
if (json.age && typeof json.age !== 'number') return false;
if (!isStringArray(json.orgs)) 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 Video
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export default function Video({
mp4,
webm,
poster,
autoplay,
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
function SearchPage({ org, ...props }: SearchPageProps): JSX.Element {
usePage('Org 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 EditPage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function EditPage({
people,
loading,
checked,
error,
- 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 CreatePage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function CreatePage({
people,
loading,
checked,
error,
- 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 Switcher
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function Switcher(): JSX.Element {
const { t } = useTranslation();
const { pathname, query } = useRouter();
const { user, orgs, loggedIn } = useUser();
- 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 account
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default async function account(req: Req, res: Res<Subject[]>): Promise<void> {
if (req.method !== 'GET') {
res.setHeader('Allow', ['GET', 'PUT']);
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 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"