Showing 82 of 278 total issues
Function update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async update(stream: Stream): Promise<Stream> {
const data = await this._prisma.stream.update({
where: {
id: stream.id.value,
},
Function update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async update(performer: Performer): Promise<Performer> {
const entry: Prisma.PerformerUncheckedUpdateInput = {
name: performer.name.value,
color: performer.color.hex(),
description: unwrap(performer.description),
Function main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const main = async (): Promise<void> => {
logger.info(`Seeding ${organizations.length} organizations...`);
for (const organization of organizations) {
await upsertOrganization.invoke({
name: organization.name,
Consider simplifying this complex logical expression. Open
if (
video.id == null ||
video.snippet == null ||
video.snippet.title == null ||
video.snippet.channelId == null ||
Function appErrorHandler
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const appErrorHandler: ErrorRequestHandler = (
error,
_req,
res,
next,
- 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 Streams
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Streams = (props: StreamsProps): JSX.Element | null => {
const { data: streams, isValidating } = useAspidaSWR(client.rest.v1.streams, {
query: { since, until },
});
- 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 notify
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Post('/')
@UseBefore()
@OnUndefined(200)
async notify(@Body() body: Required<Methods['post']['reqBody']>) {
if (
- 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 StreamPure
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const StreamPure = (props: EventProps): JSX.Element => {
const { stream, variant, embedType = 'interaction', layout, ...rest } = props;
const now = useNow();
const { autoplayEnabled } = useAutoplay();
- 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 useDelayedHover
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useDelayedHover = (
timeout = HALF_SECOND,
): UseDelayedHoverResponse => {
const cancelToken = useRef<number | null>(null);
const [hover, setHover] = 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 AvatarGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const AvatarGroup = (props: AvatarGroupProps): JSX.Element | null => {
const { src, alt, ...rest } = props;
if (src == null) {
return null;
- 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
Avoid too many return
statements within this function. Open
return avatarGroupTrio(src, alt, rest);
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return avatarGroupQuartet(src, alt, rest);
Avoid too many return
statements within this function. Open
return true;
Function invoke
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async invoke(command: ShowPerformerCommand): Promise<PerformerDto> {
if ('id' in command) {
const performerId = new PerformerId(command.id);
const performer = await this._performerQueryService.query(performerId);
- 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 ActiveLivers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ActiveLivers = (props: ActiveLiversProps): JSX.Element => {
const { upcomingEvents: events } = props;
const [expanded, setExpanded] = useState(false);
useEffect(() => {
- 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 Crown
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Crown = (props: CrownProps): JSX.Element => {
const { genre, genres, loading, onGenreChange } = props;
const { focusedAt, startAt, endAt, setFocusedAt } = useTimetable();
// "today" or "yesterday" "tomorrow" here are defined as relative from the focus
- 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 Timetable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Timetable = (props: TimetableProps): JSX.Element => {
const { schedules, swapDelta, loading } = props;
const { ref, scale, startAt, setFocusedAt, setFocusedAtRaw } = useTimetable();
const { x: fromLeft } = useScroll(ref);
- 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 Events
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Events = (props: EventsProps): JSX.Element | null => {
const { events, loading } = useEvents();
const upcomingEvents = useUpcomingEvents();
const genreQuery = useGenreQueryParam();
const [genre, setGenre] = useState(genreQuery ?? GENRE_ALL);
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async create(channel: Channel): Promise<void> {
if (channel instanceof ChannelYoutube) {
await this._prisma.channel.create({
data: {
id: channel.id.value,
- 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"