neet/refined-itsukara-link

View on GitHub

Showing 82 of 278 total issues

Function aspidaSupertestClient has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const aspidaSupertestClient = <C>(
  supertest: supertest.SuperTest<supertest.Test>,
) =>
  ({
    baseURL: '',
Severity: Minor
Found in packages/@neet/vschedule-api/test-utils/aspida-supertest-client.ts - About 2 hrs 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 Slide has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const Slide = (props: SlideProps): JSX.Element | null => {
  const { title, pages, show, onHide } = props;

  const [pageNum, setPageNum] = useState(0);
  const titleNode = useRef<HTMLElement | null>(null);
Severity: Major
Found in packages/@neet/vschedule-client/src/components/ui/Slide/Slide.tsx - About 2 hrs to fix

    Function createFromVideo has 46 lines of code (exceeds 25 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

      Function Switch has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const Switch = (props: SwitchProps): JSX.Element => {
        const { value, className, onChange, ...rest } = props;
      
        const [enabled, setEnabled] = useState(value);
      
      
      Severity: Minor
      Found in packages/@neet/vschedule-client/src/components/ui/Switch/Switch.tsx - About 1 hr to fix

        Function configure has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public configure(): Application {
            const app = express();
            const winstonInstance = this._logger as winston.Logger;
        
            // parser
        Severity: Minor
        Found in packages/@neet/vschedule-api/src/infra/app.ts - About 1 hr to fix

          Function Item has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const Item = (props: ItemProps): JSX.Element => {
            const { title, href, icon } = props;
            const router = useRouter();
            const active = router.pathname === href;
          
          

            Function mapVariant has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const mapVariant = (variant: Variant): string => {
              switch (variant) {
                case 'primary':
                  return classNames(
                    'bg-primary-500',
            Severity: Minor
            Found in packages/@neet/vschedule-client/src/components/ui/Button/Button.tsx - About 1 hr to fix

              Function User has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const User = (): JSX.Element => {
                const [swapDelta, setSwapDelta] = useSwapDelta();
                const { autoplayEnabled, setAutoplay } = useAutoplay();
              
                return (
              Severity: Minor
              Found in packages/@neet/vschedule-client/src/pages/user.tsx - About 1 hr to fix

                Function ScheduleListPure has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const ScheduleListPure = (props: ScheduleListProps): JSX.Element => {
                  const { schedules } = props;
                  const { interval } = useTimetable();
                
                  const segments = useMemo(() => {

                  Function StreamPure has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const StreamPure = (props: EventProps): JSX.Element => {
                    const { stream, variant, embedType = 'interaction', layout, ...rest } = props;
                  
                    const now = useNow();
                    const { autoplayEnabled } = useAutoplay();

                    Function Tags has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const Tags = (props: TagsProps): JSX.Element => {
                      const { data } = props;
                      const { genres } = useGenres({ fallbackData: data });
                    
                      return (
                    Severity: Minor
                    Found in packages/@neet/vschedule-client/src/pages/tags.tsx - About 1 hr to fix

                      Function isOverlapping has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const isOverlapping = (
                        [xStartAt, xEndAt]: DayjsPair,
                        [yStartAt, yEndAt]: DayjsPair,
                      ): boolean => {
                        /**
                      Severity: Minor
                      Found in packages/@neet/vschedule-client/src/utils/overlap.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 Liver has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const Liver = (props: LiverProps): JSX.Element => {
                        const { liver, twitter, youtube, size } = props;
                      
                        return (
                          <User
                      Severity: Minor
                      Found in packages/@neet/vschedule-client/src/components/app/Liver/Liver.tsx - About 1 hr to fix

                        Function render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          public render(): JSX.Element {
                            return (
                              <Html lang="ja">
                                <Head>
                                  <meta charSet="utf-8" />
                        Severity: Minor
                        Found in packages/@neet/vschedule-client/src/pages/_document.tsx - About 1 hr to fix

                          Function upsert has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            async upsert(stream: Stream): Promise<Stream> {
                              const data = await this._prisma.stream.upsert({
                                where: {
                                  id: stream.id.value,
                                },

                            Function Title has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              (props, forwardedRef) => {
                                const { children, className, ...rest } = props;
                            
                                const { onHide } = useModal();
                            
                            
                            Severity: Minor
                            Found in packages/@neet/vschedule-client/src/components/ui/Modal/Title.tsx - About 1 hr to fix

                              Function EventPure has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const EventPure = (props: EventProps): JSX.Element => {
                                const { event, variant, embedType = 'interaction', layout, ...rest } = props;
                              
                                const now = useNow();
                                const { autoplayEnabled } = useAutoplay();
                              Severity: Minor
                              Found in packages/@neet/vschedule-client/src/components/app/Event/Event.tsx - About 1 hr to fix

                                Function Livers has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const Livers = (props: LiversProps): JSX.Element => {
                                  const { data } = props;
                                  const { livers } = useLivers({ fallbackData: data });
                                
                                  return (
                                Severity: Minor
                                Found in packages/@neet/vschedule-client/src/pages/livers.tsx - About 1 hr to fix

                                  Function SearchPure has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const SearchPure = (props: SearchProps): JSX.Element => {
                                    const { show, loading, events, onHide } = props;
                                  
                                    const [ref, setRef] = useState<HTMLInputElement | null>(null);
                                    const listbox = useRef<HTMLUListElement | null>(null);

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

                                    public constructor() {
                                      super({
                                        youtube: {
                                          dataApiKey: env('YOUTUBE_DATA_API_KEY'),
                                          websubHmacSecret: env('YOUTUBE_WEBSUB_HMAC_SECRET'),
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language