yasshi2525/RushHour

View on GitHub

Showing 224 of 224 total issues

Avoid deeply nested control flow statements.
Open

                    if rn != to {
                        var connected bool
                        for _, e := range rn.OutEdges {
                            if e.ToNode == to {
                                connected = true
Severity: Major
Found in services/model.go - About 45 mins to fix

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

    const useStyles = makeStyles((theme: Theme) =>
      createStyles({
        error: {
          color: theme.palette.error.main
        }
    Severity: Minor
    Found in client/src/components/LogOut.tsx and 1 other location - About 40 mins to fix
    client/src/components/Application.tsx on lines 15..21

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

    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

    const defaultValues: {
      pid: number;
      cid: number;
      mul: number;
    } = {
    Severity: Major
    Found in client/src/models/zoom.ts and 2 other locations - About 40 mins to fix
    client/src/models/rail.ts on lines 17..25
    client/src/models/rail.ts on lines 135..143

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

    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

    const reDefaultValues: {
      from: number;
      to: number;
      eid: number;
    } = {
    Severity: Major
    Found in client/src/models/rail.ts and 2 other locations - About 40 mins to fix
    client/src/models/rail.ts on lines 17..25
    client/src/models/zoom.ts on lines 7..15

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

    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

      const onTouchMove = useCallback(
        (e: React.TouchEvent) => {
          if (pressed) {
            setNow(touch(e, model));
          }
    Severity: Major
    Found in client/src/common/scroll.ts and 2 other locations - About 40 mins to fix
    client/src/common/scroll.ts on lines 57..64
    client/src/common/zoom.ts on lines 121..128

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

    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

    const rnDefaultValues: {
      pid: number;
      cid: number;
      mul: number;
    } = {
    Severity: Major
    Found in client/src/models/rail.ts and 2 other locations - About 40 mins to fix
    client/src/models/rail.ts on lines 135..143
    client/src/models/zoom.ts on lines 7..15

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

    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

      const onMouseMove = useCallback(
        (e: React.MouseEvent) => {
          if (pressed) {
            setNow(mouse(e, model));
          }
    Severity: Major
    Found in client/src/common/scroll.ts and 2 other locations - About 40 mins to fix
    client/src/common/scroll.ts on lines 136..143
    client/src/common/zoom.ts on lines 121..128

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

    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

    const useStyles = makeStyles((theme: Theme) =>
      createStyles({
        error: {
          color: theme.palette.error.main
        }
    Severity: Minor
    Found in client/src/components/Application.tsx and 1 other location - About 40 mins to fix
    client/src/components/LogOut.tsx on lines 14..20

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

    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

      const onTouchMove = useCallback(
        (e: React.TouchEvent) => {
          if (pressed) {
            setNow(gravity(e, model));
          }
    Severity: Major
    Found in client/src/common/zoom.ts and 2 other locations - About 40 mins to fix
    client/src/common/scroll.ts on lines 57..64
    client/src/common/scroll.ts on lines 136..143

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

    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

    Method Auther.GetGitHubOAuthInfo has 6 return statements (exceeds 4 allowed).
    Open

    func (a *Auther) GetGitHubOAuthInfo(resState string, code string) (*OAuthInfo, error) {
        if resState != a.state {
            return nil, fmt.Errorf("invalid state")
        }
        ctx := context.Background()
    Severity: Major
    Found in auth/github.go - About 40 mins to fix

      Method Chunk.Has has 6 return statements (exceeds 4 allowed).
      Open

      func (ch *Chunk) Has(raw Entity) bool {
          id := reflect.ValueOf(raw.B().ID)
          switch obj := raw.(type) {
          case Localable:
              fieldName := obj.B().T.String()
      Severity: Major
      Found in entities/chunk.go - About 40 mins to fix

        Function ConnectRailNode has 6 return statements (exceeds 4 allowed).
        Open

        func ConnectRailNode(o *entities.Player, from *entities.RailNode, to *entities.RailNode, scale int) (*entities.DelegateRailEdge, error) {
            if err := CheckAuth(o, from); err != nil {
                return nil, err
            }
            if err := CheckAuth(o, to); err != nil {
        Severity: Major
        Found in services/rail.go - About 40 mins to fix

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

            setupAfterCallback() {
              super.setupAfterCallback();
              this.addAfterCallback(() => this.container.removeChild(this.graphics));
            }
          Severity: Minor
          Found in client/src/models/graphics.ts and 1 other location - About 40 mins to fix
          client/src/models/sprite.ts on lines 62..65

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

          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

            setupAfterCallback() {
              super.setupAfterCallback();
              this.addAfterCallback(() => this.container.removeChild(this.sprite));
            }
          Severity: Minor
          Found in client/src/models/sprite.ts and 1 other location - About 40 mins to fix
          client/src/models/graphics.ts on lines 21..24

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

          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 WarnLongExec has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func WarnLongExec(start time.Time, lock time.Time, max time.Duration, title string, verbose ...bool) {
          Severity: Minor
          Found in services/debug.go - About 35 mins to fix

            Function PasswordSignUp has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func PasswordSignUp(loginid string, name string, password string, hue int, lv entities.PlayerType) (*entities.Player, error) {
            Severity: Minor
            Found in services/player.go - About 35 mins to fix

              Function CreatePlayer has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func CreatePlayer(loginid string, displayname string, password string, hue int, lv entities.PlayerType) (*entities.Player, error) {
              Severity: Minor
              Found in services/player.go - About 35 mins to fix

                Function ExtendRailNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func ExtendRailNode(o *entities.Player, from *entities.RailNode,
                    x float64, y float64, scale int) (*entities.DelegateRailNode, *entities.DelegateRailEdge, error) {
                Severity: Minor
                Found in services/rail.go - About 35 mins to fix

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

                        this.current.x =
                          this.current.x * ratio + this.destination.x * (1 - ratio);
                  Severity: Minor
                  Found in client/src/models/pixi.ts and 1 other location - About 35 mins to fix
                  client/src/models/pixi.ts on lines 183..184

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

                  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

                        this.current.y =
                          this.current.y * ratio + this.destination.y * (1 - ratio);
                  Severity: Minor
                  Found in client/src/models/pixi.ts and 1 other location - About 35 mins to fix
                  client/src/models/pixi.ts on lines 181..182

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

                  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