neet/refined-itsukara-link

View on GitHub

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,
      Severity: Minor
      Found in packages/@neet/vschedule-api/prisma/seed.ts - About 1 hr to fix

        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,
          Severity: Minor
          Found in packages/@neet/vschedule-api/src/infra/middlewares/app-error-handler.ts - About 55 mins to fix

          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 },
            });
          
          
          Severity: Minor
          Found in packages/@neet/vschedule-client/src/pages/streams.tsx - About 45 mins to fix

          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 (
          Severity: Minor
          Found in packages/@neet/vschedule-api/src/adapters/controllers/websub/youtube.ts - About 45 mins to fix

          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();
          Severity: Minor
          Found in packages/@neet/vschedule-client/src/components/app/Stream/Stream.tsx - About 35 mins to fix

          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);
          Severity: Minor
          Found in packages/@neet/vschedule-client/src/components/hooks/useDelayedHover.ts - About 35 mins to fix

          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;
          Severity: Minor
          Found in packages/@neet/vschedule-client/src/components/ui/Avatar/AvatarGroup.tsx - About 35 mins to fix

          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);
          Severity: Major
          Found in packages/@neet/vschedule-client/src/components/ui/Avatar/AvatarGroup.tsx - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return false;
            Severity: Major
            Found in packages/@neet/vschedule-client/src/utils/overlap.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return avatarGroupQuartet(src, alt, rest);
              Severity: Major
              Found in packages/@neet/vschedule-client/src/components/ui/Avatar/AvatarGroup.tsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return true;
                Severity: Major
                Found in packages/@neet/vschedule-client/src/utils/overlap.ts - About 30 mins to fix

                  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);
                  
                  
                  Severity: Minor
                  Found in packages/@neet/vschedule-api/src/app/performer/show-performer.ts - About 25 mins to fix

                  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(() => {

                  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
                  Severity: Minor
                  Found in packages/@neet/vschedule-client/src/components/app/Crown/Crown.tsx - About 25 mins to fix

                  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);

                  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);
                  Severity: Minor
                  Found in packages/@neet/vschedule-client/src/pages/index.tsx - About 25 mins to fix

                  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,

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language