Showing 137 of 365 total issues
Avoid too many return
statements within this function. Open
if (userKey === "right" && eventKey !== "ArrowRight") return;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return selectedFile.smallUrl;
Avoid too many return
statements within this function. Open
return num;
Function seedFoods
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function seedFoods() {
console.log("Seeding foods");
let total = 0;
for (const user of users) {
- 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 seedFoodEntries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function seedFoodEntries() {
console.log("Seeding user foodLogs");
let total = 0;
for (const user of users) {
- 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 getVisualizationDataResolvers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getVisualizationDataResolvers({
activityId,
activityType,
userId,
context,
- 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 BarcodeScanner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function BarcodeScanner({ day, close }: { day: string, close: () => void }) {
// Good test code: "850009682307"
const [codes, setCodes] = React.useState<string[]>([]);
const [showShutter, setShowShutter] = React.useState(false);
const [searchingBarcode, setSearchingBarcode] = React.useState(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 MarkdownRenderer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function MarkdownRenderer(props: MarkdownProps) {
const text = React.useMemo(() => {
if (!props.maxLength) {
return props.content;
}
- 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 stats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function stats(
context: Context,
{
userId,
activityId,
- 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 usePaginatedQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function usePaginatedQuery<
THookFn extends HookFunction,
TGetConnection extends GetConnectionFn<THookFn>
>(
useQuery: THookFn,
- 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 DayNavigator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function DayNavigator({
rootUrl,
onRefresh = inert,
}: {
onRefresh?: () => void;
- 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 MuscleMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function MuscleMap({
active = false,
selected = [],
showSummary = false,
onChange,
- 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 ActivityTileMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function ActivityTileMap({
data,
activityType,
activityId,
}: {
- 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 log
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function log(
level: "debug" | "error" | "info" | "warn",
message: string,
details?: Record<string, any>
): void {
- 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"