igara/syonet_seven

View on GitHub

Showing 138 of 138 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export const callItems = async (): Promise<Item[]> => {
  const result = await fetch("https://api.github.com/repos/igara/qiita-export/contents/data/igara", {
    method: "GET",
  });

Severity: Major
Found in nodejs/www/libs/fetchs/github/qiita.ts and 2 other locations - About 1 hr to fix
nodejs/www/libs/fetchs/github/hatena.ts on lines 20..27
nodejs/www/libs/fetchs/github/speakerdeck.ts on lines 20..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export const callEntries = async (): Promise<Entry[]> => {
  const result = await fetch("https://api.github.com/repos/igara/hatenablog-export/contents/data/igara1119", {
    method: "GET",
  });

Severity: Major
Found in nodejs/www/libs/fetchs/github/hatena.ts and 2 other locations - About 1 hr to fix
nodejs/www/libs/fetchs/github/qiita.ts on lines 20..27
nodejs/www/libs/fetchs/github/speakerdeck.ts on lines 20..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export const callDecks = async (): Promise<Deck[]> => {
  const result = await fetch("https://api.github.com/repos/igara/speakerdeck-export/contents/data/igara", {
    method: "GET",
  });

Severity: Major
Found in nodejs/www/libs/fetchs/github/speakerdeck.ts and 2 other locations - About 1 hr to fix
nodejs/www/libs/fetchs/github/hatena.ts on lines 20..27
nodejs/www/libs/fetchs/github/qiita.ts on lines 20..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

export type GetMultiFormatDateTimeParamOption = {
  Date?: Date;
  seconds?: number;
  minutes?: number;
  hours?: number;
Severity: Major
Found in nodejs/www/libs/datetime.ts and 1 other location - About 1 hr to fix
nodejs/api/src/libs/datetime.ts on lines 3..12

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 67.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

export type GetMultiFormatDateTimeParamOption = {
  Date?: Date;
  seconds?: number;
  minutes?: number;
  hours?: number;
Severity: Major
Found in nodejs/api/src/libs/datetime.ts and 1 other location - About 1 hr to fix
nodejs/www/libs/datetime.ts on lines 3..12

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 67.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  @Mutation(() => SaveScrapingHTML, { nullable: true })
  async saveScrapingHTML(
    @Ctx() ctx: Context,
    @Arg("html") html: string,
    @Arg("url") url: string,
Severity: Minor
Found in nodejs/api/src/resolvers/google/scraping.ts - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      app.get("/", (_: express.Request, res: express.Response) => {
        return res.send(
          JSON.stringify({
            message: "Pong Syonet API.",
          })
    Severity: Major
    Found in nodejs/api/src/express.ts and 1 other location - About 1 hr to fix
    nodejs/websocket/ssb/src/express.ts on lines 7..13

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 64.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      app.get("/", (_: express.Request, res: express.Response) => {
        return res.send(
          JSON.stringify({
            message: "Pong Syonet SSB.",
          })
    Severity: Major
    Found in nodejs/websocket/ssb/src/express.ts and 1 other location - About 1 hr to fix
    nodejs/api/src/express.ts on lines 44..50

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 64.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    const BlogsJinseiPageComponent = (props: Props) => {
      const state = useSelector((state: AppState) => state);
      const dispatch = useDispatch();
    
      const [loadCheckAuth] = useLazyQuery<CheckAuth>(CHECK_AUTH, {
    Severity: Minor
    Found in nodejs/www/pages/blogs/jinsei.tsx - About 1 hr to fix

      Function main has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const main = async () => {
        // https://github.com/MichalLytek/type-graphql/issues/869#issuecomment-824887201
        (global as any).schema =
          (global as any).schema ||
          (await buildSchema({
      Severity: Minor
      Found in nodejs/api/src/apollo.ts - About 1 hr to fix

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                <li className={sidebarStyle.sidebar_link_list} onClick={() => dispatch(sidebarActions.onClickTools(false))}>
                  <LinkComponent href="/tools">ツール</LinkComponent>
                </li>
        Severity: Major
        Found in nodejs/www/components/common/sidebar.tsx and 3 other locations - About 1 hr to fix
        nodejs/www/components/common/sidebar.tsx on lines 31..33
        nodejs/www/components/common/sidebar.tsx on lines 50..52
        nodejs/www/components/common/sidebar.tsx on lines 57..59

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 63.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                  <li className={sidebarStyle.sidebar_link_list} onClick={() => dispatch(sidebarActions.onClickLogin(false))}>
                    <LinkComponent href="/login">ログイン</LinkComponent>
                  </li>
        Severity: Major
        Found in nodejs/www/components/common/sidebar.tsx and 3 other locations - About 1 hr to fix
        nodejs/www/components/common/sidebar.tsx on lines 31..33
        nodejs/www/components/common/sidebar.tsx on lines 54..56
        nodejs/www/components/common/sidebar.tsx on lines 57..59

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 63.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function _getMultiFormatDateTimeOptions has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const _getMultiFormatDateTimeOptions = (
          options: GetMultiFormatDateTimeParamOption,
        ): GetMultiFormatDateTimeReturnOption => {
          const newOptions: GetMultiFormatDateTimeReturnOption = {
            Date: new Date(),
        Severity: Minor
        Found in nodejs/www/libs/datetime.ts - About 1 hr to fix

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

                  <li className={sidebarStyle.sidebar_link_list} onClick={() => dispatch(sidebarActions.onClickHome(false))}>
                    <LinkComponent href="/">ホーム</LinkComponent>
                  </li>
          Severity: Major
          Found in nodejs/www/components/common/sidebar.tsx and 3 other locations - About 1 hr to fix
          nodejs/www/components/common/sidebar.tsx on lines 50..52
          nodejs/www/components/common/sidebar.tsx on lines 54..56
          nodejs/www/components/common/sidebar.tsx on lines 57..59

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                <ul
                  className={`${sidebarStyle.sidebar_link_wrap_ul} ${states.sidebar.chengedDispFlag &&
                    (states.sidebar.dispFlag ? sidebarStyle.able : sidebarStyle.hidden)}`}
                >
                  <li className={sidebarStyle.sidebar_link_list} onClick={() => dispatch(sidebarActions.onClickClose(false))}>
          Severity: Major
          Found in nodejs/www/components/common/sidebar.tsx and 2 other locations - About 1 hr to fix
          nodejs/www/components/common/sidebar.tsx on lines 19..22
          nodejs/www/components/common/term.tsx on lines 16..32

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                <div
                  className={`${sidebarStyle.sidebar_overlay_div} ${states.sidebar.chengedDispFlag &&
                    (states.sidebar.dispFlag ? sidebarStyle.able : sidebarStyle.hidden)}`}
                />
          Severity: Major
          Found in nodejs/www/components/common/sidebar.tsx and 2 other locations - About 1 hr to fix
          nodejs/www/components/common/sidebar.tsx on lines 24..87
          nodejs/www/components/common/term.tsx on lines 16..32

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                <div
                  className={`${termStyle.term_overlay_div} ${states.term.chengedDispFlag &&
                    (states.term.dispFlag ? termStyle.able : termStyle.hidden)}`}
                >
                  <div className={termStyle.term_content}>
          Severity: Major
          Found in nodejs/www/components/common/term.tsx and 2 other locations - About 1 hr to fix
          nodejs/www/components/common/sidebar.tsx on lines 19..22
          nodejs/www/components/common/sidebar.tsx on lines 24..87

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function _getMultiFormatDateTimeOptions has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const _getMultiFormatDateTimeOptions = (
            options: GetMultiFormatDateTimeParamOption,
          ): GetMultiFormatDateTimeReturnOption => {
            const newOptions: GetMultiFormatDateTimeReturnOption = {
              Date: new Date(),
          Severity: Minor
          Found in nodejs/api/src/libs/datetime.ts - About 1 hr to fix

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

                    <li className={sidebarStyle.sidebar_link_list} onClick={() => dispatch(sidebarActions.onClickTools(false))}>
                      <LinkComponent href="/blogs">ブログ</LinkComponent>
                    </li>
            Severity: Major
            Found in nodejs/www/components/common/sidebar.tsx and 3 other locations - About 1 hr to fix
            nodejs/www/components/common/sidebar.tsx on lines 31..33
            nodejs/www/components/common/sidebar.tsx on lines 50..52
            nodejs/www/components/common/sidebar.tsx on lines 54..56

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 63.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            const main = () => {
              const app = express();
              const router = express.Router();
            
              // Middleware
            Severity: Minor
            Found in nodejs/api/src/express.ts - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language