yasshi2525/RushHour

View on GitHub

Showing 224 of 224 total issues

Human has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

type Human struct {
    Base
    Persistence
    Point

Severity: Minor
Found in entities/human.go - About 3 hrs to fix

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

    export const ClockProvider: FC = props => {
      const offset = useClock();
      useEffect(() => {
        console.info("after ClockProvider");
      }, []);
    Severity: Major
    Found in client/src/common/clock.tsx and 3 other locations - About 3 hrs to fix
    client/src/common/coord.tsx on lines 265..278
    client/src/common/delegate.tsx on lines 44..57
    client/src/common/windows.tsx on lines 37..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 104.

    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

    export const WindowProvider: FC = props => {
      const size = useWindow();
      useEffect(() => {
        console.info("after WindowProvider");
      }, []);
    Severity: Major
    Found in client/src/common/windows.tsx and 3 other locations - About 3 hrs to fix
    client/src/common/clock.tsx on lines 22..35
    client/src/common/coord.tsx on lines 265..278
    client/src/common/delegate.tsx on lines 44..57

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

    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

    export const DelegateProvider: FC = props => {
      const delegate = useDelegate();
      useEffect(() => {
        console.info("after DelegateProvider");
      }, []);
    Severity: Major
    Found in client/src/common/delegate.tsx and 3 other locations - About 3 hrs to fix
    client/src/common/clock.tsx on lines 22..35
    client/src/common/coord.tsx on lines 265..278
    client/src/common/windows.tsx on lines 37..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 104.

    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

    export const CoordProvider: FC = props => {
      const context = useCoord();
      useEffect(() => {
        console.info("after CoordProvider");
      }, []);
    Severity: Major
    Found in client/src/common/coord.tsx and 3 other locations - About 3 hrs to fix
    client/src/common/clock.tsx on lines 22..35
    client/src/common/delegate.tsx on lines 44..57
    client/src/common/windows.tsx on lines 37..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 104.

    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

      protected setCursor(cursor: RailNode | undefined) {
        let id = cursor !== undefined ? cursor.get("id") : undefined;
        if (this.cursorOut !== undefined && this.cursorIn !== undefined) {
          this.cursorOut.merge("from", id);
          this.cursorIn.merge("to", id);
    Severity: Major
    Found in client/src/models/rail.ts and 1 other location - About 3 hrs to fix
    client/src/models/rail.ts on lines 342..348

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

    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

      protected setAnchor(anchor: RailNode | undefined) {
        let id = anchor !== undefined ? anchor.get("id") : undefined;
        if (this.cursorOut !== undefined && this.cursorIn !== undefined) {
          this.cursorOut.merge("to", id);
          this.cursorIn.merge("from", id);
    Severity: Major
    Found in client/src/models/rail.ts and 1 other location - About 3 hrs to fix
    client/src/models/rail.ts on lines 350..356

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

    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

                    <TextField
                      error={pwError}
                      name="password"
                      label="パスワード"
                      type="password"
    Severity: Major
    Found in client/src/components/Register.tsx and 1 other location - About 3 hrs to fix
    client/src/components/Register.tsx on lines 216..230

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

    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

                    <TextField
                      error={cnfError}
                      name="confirm"
                      label="パスワード(確認)"
                      type="password"
    Severity: Major
    Found in client/src/components/Register.tsx and 1 other location - About 3 hrs to fix
    client/src/components/Register.tsx on lines 201..215

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

    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

      protected linkFrom(from: RailNode | undefined) {
        if (this.from !== from) {
          this.from = from;
          if (from !== undefined) {
            from.out[this.props.id] = this;
    Severity: Major
    Found in client/src/models/rail.ts and 1 other location - About 3 hrs to fix
    client/src/models/rail.ts on lines 232..240

    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 2 locations. Consider refactoring.
    Open

    export const useHttpGet = <I extends FlatObject, O extends SerializableObject>(
      endpoint: GetEndpoint<I, O> | GetAuthEndpoint<I, O>
    ) => {
      return useHttpCommon<GetEndpoint<I, O> | GetAuthEndpoint<I, O>, I, O>(
        endpoint,
    Severity: Major
    Found in client/src/common/utils/http_get.ts and 1 other location - About 3 hrs to fix
    client/src/common/utils/http_http.ts on lines 57..67

    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 2 locations. Consider refactoring.
    Open

      protected linkTo(to: RailNode | undefined) {
        if (this.to !== to) {
          this.to = to;
          if (to !== undefined) {
            to.in[this.props.id] = this;
    Severity: Major
    Found in client/src/models/rail.ts and 1 other location - About 3 hrs to fix
    client/src/models/rail.ts on lines 222..230

    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 2 locations. Consider refactoring.
    Open

    export const useHttpHttp = <
      I extends SerializableObject,
      O extends SerializableObject
    >(
      endpoint: HttpEndpoint<I, O> | HttpAuthEndpoint<I, O>
    Severity: Major
    Found in client/src/common/utils/http_http.ts and 1 other location - About 3 hrs to fix
    client/src/common/utils/http_get.ts on lines 55..62

    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

    File border.ts has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { GraphicsModel, GraphicsContainer } from "./graphics";
    import { Monitorable, MonitorContainer } from "interfaces/monitor";
    import { BorderProperty, PIXIProperty } from "interfaces/pixi";
    import {
      config,
    Severity: Minor
    Found in client/src/models/border.ts - About 3 hrs to fix

      Function default has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function() {
        const theme = useTheme();
        const classes = useStyles(theme);
        const [id, setUserID] = React.useState("");
        const [password, setPassword] = React.useState("");
      Severity: Major
      Found in client/src/components/Password.tsx - About 3 hrs to fix

        File Register.tsx has 300 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import * as React from "react";
        import { useDispatch, useSelector } from "react-redux";
        import {
          Button,
          Theme,
        Severity: Minor
        Found in client/src/components/Register.tsx - About 3 hrs to fix

          Function useMultiTask has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const useMultiTask = <I, O>(
            task: Task<I, O>,
            handlers?: MultiTaskHandler<I, O>
          ): Handlers<I> => {
            const [, maintain] = useContext(OperationContext);
          Severity: Major
          Found in client/src/common/utils/task_multi.ts - About 3 hrs to fix

            Function setCenter has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

              protected setCenter(x: number, y: number) {
                let short = Math.min(this.renderer.width, this.renderer.height);
                let long = Math.max(this.renderer.width, this.renderer.height);
                let shortRadius = Math.pow(
                  2,
            Severity: Minor
            Found in client/src/models/index.ts - About 3 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

            `` has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            export default class implements Monitorable {
              protected model: GameModel;
              /**
               * 監視対象プロパティ
               */
            Severity: Minor
            Found in client/src/models/base.ts - About 3 hrs to fix

              Function default has 74 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function() {
                const classes = useStyles();
                const [opened, setOpened] = React.useState(false);
                const theme = useTheme();
                const isFullScreen = useMediaQuery(theme.breakpoints.down("sm"));
              Severity: Major
              Found in client/src/components/SignIn.tsx - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language