igara/syonet_seven

View on GitHub

Showing 138 of 138 total issues

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

export type Item = {
  name: string;
  path: string;
  sha: string;
  size: number;
Severity: Major
Found in nodejs/www/libs/fetchs/github/qiita.ts and 2 other locations - About 3 hrs to fix
nodejs/www/libs/fetchs/github/hatena.ts on lines 3..18
nodejs/www/libs/fetchs/github/speakerdeck.ts on lines 3..18

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 101.

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 type Deck = {
  name: string;
  path: string;
  sha: string;
  size: number;
Severity: Major
Found in nodejs/www/libs/fetchs/github/speakerdeck.ts and 2 other locations - About 3 hrs to fix
nodejs/www/libs/fetchs/github/hatena.ts on lines 3..18
nodejs/www/libs/fetchs/github/qiita.ts on lines 3..18

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 101.

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 type Entry = {
  name: string;
  path: string;
  sha: string;
  size: number;
Severity: Major
Found in nodejs/www/libs/fetchs/github/hatena.ts and 2 other locations - About 3 hrs to fix
nodejs/www/libs/fetchs/github/qiita.ts on lines 3..18
nodejs/www/libs/fetchs/github/speakerdeck.ts on lines 3..18

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 101.

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

export const SidebarComponent = () => {
  const states = useSelector((state: AppState) => state);
  const dispatch = useDispatch();

  return (
Severity: Major
Found in nodejs/www/components/common/sidebar.tsx - About 3 hrs to fix

    Function ToolsSsbPageComponent has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ToolsSsbPageComponent = () => {
      const dispatch = useDispatch();
      const [loadCheckAuth] = useLazyQuery<CheckAuth>(CHECK_AUTH, {
        onCompleted: async checkAuth => {
          if (!checkAuth.checkAuth) {
    Severity: Major
    Found in nodejs/www/pages/tools/ssb.tsx - About 3 hrs to fix

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

                    <tr>
                      <td>FileID: </td>
                      <td>
                        {fileID && (
                          <a
      Severity: Major
      Found in nodejs/www/pages/tools/scraping.tsx and 1 other location - About 3 hrs to fix
      nodejs/www/pages/tools/scraping.tsx on lines 193..207

      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 99.

      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

                    <tr>
                      <td>DirectoryID: </td>
                      <td>
                        {directoryID && (
                          <a
      Severity: Major
      Found in nodejs/www/pages/tools/scraping.tsx and 1 other location - About 3 hrs to fix
      nodejs/www/pages/tools/scraping.tsx on lines 178..192

      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 99.

      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 connectHandler has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      export const connectHandler = async (event: APIGatewayEvent) => {
        const connectionId = event.requestContext.connectionId;
        if (!connectionId) return;
      
        const body = event.body as any;
      Severity: Minor
      Found in nodejs/websocket/ssb/src/lambda.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 vrmLoad has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const vrmLoad = async (divElement: HTMLDivElement, videoElement: HTMLVideoElement) => {
        const { GLTFLoader } = await import("three/examples/jsm/loaders/GLTFLoader");
        const { OrbitControls } = await import("three/examples/jsm/controls/OrbitControls");
      
        const width = 320;
      Severity: Major
      Found in nodejs/www/pages/tools/vrm/index.tsx - About 2 hrs to fix

        Function vrmLoad has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        const vrmLoad = async (divElement: HTMLDivElement, videoElement: HTMLVideoElement) => {
          const { GLTFLoader } = await import("three/examples/jsm/loaders/GLTFLoader");
          const { OrbitControls } = await import("three/examples/jsm/controls/OrbitControls");
        
          const width = 320;
        Severity: Minor
        Found in nodejs/www/pages/tools/vrm/index.tsx - 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 ToolsSoundPageComponent has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        const ToolsSoundPageComponent = () => {
          const dispatch = useDispatch();
        
          const [name, setName] = useState("");
          const changeName = (event: ChangeEvent<HTMLInputElement>) => setName(event.target.value);
        Severity: Minor
        Found in nodejs/www/pages/tools/sound/index.tsx - 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 BlogsPageComponent has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const BlogsPageComponent = () => {
          const dispatch = useDispatch();
        
          const [loadCheckAuth] = useLazyQuery<CheckAuth>(CHECK_AUTH, {
            onCompleted: async checkAuth => {
        Severity: Major
        Found in nodejs/www/pages/blogs/index.tsx - About 2 hrs to fix

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

                    <li>
                      <LinkComponent href="/blogs/speakerdeck">Speaker Deck バックアップ</LinkComponent>
                      <ul>
                        <li>
                          <a href="https://speakerdeck.com/igara" target="_blank" rel="noopener">
          Severity: Major
          Found in nodejs/www/pages/blogs/index.tsx and 2 other locations - About 2 hrs to fix
          nodejs/www/pages/blogs/index.tsx on lines 54..63
          nodejs/www/pages/blogs/index.tsx on lines 64..73

          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 84.

          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

                    <li>
                      <LinkComponent href="/blogs/qiita">Qiita バックアップ</LinkComponent>
                      <ul>
                        <li>
                          <a href="https://qiita.com/igara" target="_blank" rel="noopener">
          Severity: Major
          Found in nodejs/www/pages/blogs/index.tsx and 2 other locations - About 2 hrs to fix
          nodejs/www/pages/blogs/index.tsx on lines 64..73
          nodejs/www/pages/blogs/index.tsx on lines 74..83

          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 84.

          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

                    <li>
                      <LinkComponent href="/blogs/hatena">Hatena Blog バックアップ</LinkComponent>
                      <ul>
                        <li>
                          <a href="https://igara1119.hatenablog.com/" target="_blank" rel="noopener">
          Severity: Major
          Found in nodejs/www/pages/blogs/index.tsx and 2 other locations - About 2 hrs to fix
          nodejs/www/pages/blogs/index.tsx on lines 54..63
          nodejs/www/pages/blogs/index.tsx on lines 74..83

          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 84.

          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

                if (userData.playerType == PlayerType.MAN) {
                  const content = `${userData.name} dead`;
                  const url: string = process.env.DISCORD_WEBHOCK
                    ? process.env.DISCORD_WEBHOCK
                    : "";
          Severity: Major
          Found in nodejs/websocket/ssb/src/lambda.ts and 1 other location - About 2 hrs to fix
          nodejs/websocket/ssb/src/lambda.ts on lines 90..104

          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 82.

          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

                if (userData.playerType == PlayerType.MAN) {
                  const content = `${userData.name} is fighting`;
                  const url: string = process.env.DISCORD_WEBHOCK
                    ? process.env.DISCORD_WEBHOCK
                    : "";
          Severity: Major
          Found in nodejs/websocket/ssb/src/lambda.ts and 1 other location - About 2 hrs to fix
          nodejs/websocket/ssb/src/lambda.ts on lines 164..178

          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 82.

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

          const ToolsPageComponent = () => {
            const dispatch = useDispatch();
            const [loadCheckAuth] = useLazyQuery<CheckAuth>(CHECK_AUTH, {
              onCompleted: async checkAuth => {
                if (!checkAuth.checkAuth) {
          Severity: Major
          Found in nodejs/www/pages/tools/index.tsx - About 2 hrs to fix

            Function changeFile has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const changeFile = async (event: ChangeEvent<HTMLInputElement>) => {
                if (event.target.files && event.target.files[0]) {
                  const waveformElement = document.getElementById("waveform");
                  if (waveformElement) {
                    const childElement = waveformElement.firstChild;
            Severity: Major
            Found in nodejs/www/pages/tools/sound/index.tsx - About 2 hrs to fix

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

              export const callEntry = async (name: string): Promise<string> => {
                const result = await fetch(
                  `https://raw.githubusercontent.com/igara/hatenablog-export/master/data/igara1119/${name}/README.html`,
                  {
                    method: "GET",
              Severity: Major
              Found in nodejs/www/libs/fetchs/github/hatena.ts and 1 other location - About 2 hrs to fix
              nodejs/www/libs/fetchs/github/qiita.ts on lines 29..39

              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 78.

              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

              Severity
              Category
              Status
              Source
              Language