neet/refined-itsukara-link

View on GitHub

Showing 82 of 278 total issues

Function fetch has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    fetch: (
      _prefix: string,
      path: string,
      rawMethod: HttpMethod,
      params?: AspidaParams<C> | undefined,
Severity: Minor
Found in packages/@neet/vschedule-api/test-utils/aspida-supertest-client.ts - About 1 hr to fix

    Function Navigation has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const Navigation = (): JSX.Element => {
      const [shown, setShown] = useState(false);
    
      const handleToggle = (): void => {
        setShown(!shown);

      Function queryMany has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async queryMany(params: StreamQueryManyParams): Promise<StreamDto[]> {
          const where: Prisma.StreamWhereInput & { AND: unknown[] } = { AND: [] };
      
          if (params.organizationId != null) {
            where.AND.push({

        Function useFuzzySearch has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useFuzzySearch = (
          events: readonly Event[] = [],
        ): [Event[], (term: string) => void, string | null] => {
          const [result, setResult] = useState<Event[]>(
            [...events].sort(sortByDelta).slice(0, MAX_RESULT),

          Function UpcomingEvents has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const UpcomingEvents = (props: UpcomingEventsProps): JSX.Element => {
            const { id, pinnedEventId } = props;
          
            const upcomingEvents = useMemo(() => {
              if (props.upcomingEvents == null) return;

            Function Marker has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const Marker = (props: MakerProps): JSX.Element => {
              const { backgroundColor, appearance, width, children } = props;
            
              const fgLight = meetsContrastGuidelines(backgroundColor, '#ffffff').AALarge
                ? '#ffffff'
            Severity: Minor
            Found in packages/@neet/vschedule-client/src/components/ui/Marker/Marker.tsx - About 1 hr to fix

              Function appErrorHandler has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const appErrorHandler: ErrorRequestHandler = (
                error,
                _req,
                res,
                next,

                Function UpcomingStreams has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const UpcomingStreams = (props: UpcomingStreamsProps): JSX.Element => {
                  const { id } = props;
                
                  const upcomingStreams = useMemo(() => {
                    if (props.upcomingStreams == null) return;

                  Function createFromVideo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public async createFromVideo(video: Video): Promise<Stream> {
                      const youtubeChannelId = new YoutubeChannelId(video.channelId);
                      const channel = await this._fetchChannelFromYoutubeChannel(
                        youtubeChannelId,
                      );
                  Severity: Minor
                  Found in packages/@neet/vschedule-api/src/app/stream/stream-factory-impl.ts - About 1 hr 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 invoke has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public async invoke(
                      command: VerifyYoutubeChannelSubscriptionCommand,
                    ): Promise<void> {
                      const topic = new URL(command.topic);
                      const youtubeChannelIdStr = topic.searchParams.get('channel_id');

                    Function TableDataList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const TableDataList = (props: TableDataListProps): JSX.Element | null => {
                      const { segment } = props;
                      const beginning = segment[0]?.schedule.startAt;
                    
                      const { getWidth, getItemX, getItemY } = useTimetable();

                      Function Page5 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const Page5 = (): JSX.Element => {
                        return (
                          <div role="group" aria-describedby="tutorial-5__description">
                            <div className="aspect-video relative bg-primary-500 w-full">
                              <Image

                        Function ServiceUnavailable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const ServiceUnavailable = (): JSX.Element => {
                          return (
                            <Section
                              component={
                                <Typography.ThreeXl>HTTP 503 ― Service Unavailable</Typography.ThreeXl>
                        Severity: Minor
                        Found in packages/@neet/vschedule-client/src/pages/_error.tsx - About 1 hr to fix

                          Function setFocusedAt has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                            (ctx: TimetableContext) =>
                            (date: Readonly<Dayjs>, params: SetFocusedAtParam = {}): void => {
                              const { ref, startAt, scale, setFocusedAtRaw } = ctx;
                              setFocusedAtRaw(date);
                          
                          

                          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 Button has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const Button = forwardRef<HTMLElement, Partial<ButtonProps>>((props, ref): JSX.Element => {
                            const { children, size, shape, variant, className, as, ...rest } = props as ButtonProps;
                          
                            return createElement(
                              as,
                          Severity: Minor
                          Found in packages/@neet/vschedule-client/src/components/ui/Button/Button.tsx - About 1 hr to fix

                            Function GtagScript has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const GtagScript = (): JSX.Element => {
                              if (process.env.GA_MEASUREMENT_ID == null) {
                                return (
                                  <script
                                    dangerouslySetInnerHTML={{
                            Severity: Minor
                            Found in packages/@neet/vschedule-client/src/pages/_document.tsx - About 1 hr to fix

                              Function TableDataPure has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const TableDataPure = (props: ItemProps): JSX.Element => {
                                const { schedule } = props;
                                const { getWidth, itemHeight, ref: timetable, interval } = useTimetable();
                              
                                const { ref, inView } = useInView({

                                Function update has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  async update(channel: Channel): Promise<void> {
                                    if (channel instanceof ChannelYoutube) {
                                      await this._prisma.channel.update({
                                        where: {
                                          id: channel.id.value,

                                  Function updatePerformer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private async updatePerformer(
                                      performer: Performer,
                                      command: UpsertPerformerCommand,
                                    ) {
                                      const newPerformer = performer
                                  Severity: Minor
                                  Found in packages/@neet/vschedule-api/src/app/performer/upsert-performer.ts - About 1 hr to fix

                                    Function BadgePure has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const BadgePure = (props: BadgePureProps): JSX.Element => {
                                      const { children, className } = props;
                                    
                                      return (
                                        <div
                                    Severity: Minor
                                    Found in packages/@neet/vschedule-client/src/components/ui/Badge/Badge.tsx - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language