yasshi2525/RushHour

View on GitHub

Showing 80 of 224 total issues

LineTask has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

type LineTask struct {
    Base
    Persistence

    TaskType LineTaskType `gorm:"not null" json:"type"`
Severity: Minor
Found in entities/line_task.go - About 2 hrs to fix

    Function useTask has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function usePinch has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const usePinch = () => {
        const model = useContext(ModelContext);
        const [pressed, setPressed] = useState(false);
        const [start, setStart] = useState(ZERO);
        const [now, setNow] = useState(ZERO);
      Severity: Major
      Found in client/src/common/zoom.ts - About 2 hrs to fix

        Function useCoord has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const useCoord = (): CoordState => {
          const [{ min_scale, max_scale }] = useContext(ConfigContext);
          const [w, h] = useContext(WindowContext);
          const pixi = useContext(PixiContext);
        
        
        Severity: Major
        Found in client/src/common/coord.tsx - About 2 hrs to fix

          Function useSwipe has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const useSwipe = () => {
            const model = useContext(ModelContext);
            const reload = useReload();
            const [pressed, setPressed] = useState(false);
            const [start, setStart] = useState(ZERO);
          Severity: Major
          Found in client/src/common/scroll.ts - About 2 hrs to fix

            Function default has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function(props: Attributes) {
              const [opened, setOpened] = React.useState(false);
              const theme = useTheme();
              const classes = useStyles(theme);
              const isFullScreen = useMediaQuery(theme.breakpoints.down("sm"));
            Severity: Minor
            Found in client/src/components/Register.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 useCache has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            const useCache = <T>(
              onGrace: (key: string, data: T) => void = () => {},
              onExpired: (key: string, data: T) => void = () => {},
              activeTime: number = ACTIVE,
              graceTime: number = GRACE
            Severity: Minor
            Found in client/src/common/utils/cache.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 setupUpdateCallback has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              setupUpdateCallback() {
                super.setupUpdateCallback();
                this.addUpdateCallback("delegate", () => this.refreshChildren());
                this.addUpdateCallback("coord", (v: Coordinates) => {
                  let nowChunk = getChunkByPos(
            Severity: Major
            Found in client/src/models/border.ts - About 2 hrs to fix

              Function init has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                init() {
                  let textures = this.model.app.loader.resources;
                  let props = {
                    model: this.model,
                    app: this.model.app,
              Severity: Minor
              Found in client/src/models/controller.ts - About 2 hrs to fix

                Function setupRouter has 72 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func setupRouter(secret string) *gin.Engine {
                    binding.Validator = new(v1.DefaultValidator)
                    router := gin.New()
                    router.Use(gin.Recovery())
                
                
                Severity: Minor
                Found in main.go - About 1 hr to fix

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

                  const useServerMap = (
                    key: string,
                    keyAll: string[],
                    put: (key: string, value: CoreMap) => void,
                    graceHandler: GraceHandler
                  Severity: Minor
                  Found in client/src/common/utils/map_server.ts - About 1 hr to fix

                    Function setCenter has 42 lines of code (exceeds 25 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 1 hr to fix

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

                      export const useCursor = () => {
                        const model = useContext(ModelContext);
                        const [count, setCount] = useState(0);
                        const [client, setClient] = useState<Point>();
                        const [pressed, setPressed] = useState(false);
                      Severity: Minor
                      Found in client/src/common/cursor.ts - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                      export const useDrag = () => {
                        const model = useContext(ModelContext);
                        const reload = useReload();
                        const [pressed, setPressed] = useState(false);
                        const [start, setStart] = useState(ZERO);
                      Severity: Minor
                      Found in client/src/common/scroll.ts - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                      export const useSwipe = () => {
                        const model = useContext(ModelContext);
                        const reload = useReload();
                        const [pressed, setPressed] = useState(false);
                        const [start, setStart] = useState(ZERO);
                      Severity: Minor
                      Found in client/src/common/scroll.ts - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                        const CustomName = () => {
                          if (settings === undefined) {
                            return null;
                          }
                          return (
                      Severity: Minor
                      Found in client/src/components/UserSettings.tsx - About 1 hr to fix

                        Function useCounter has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const useCounter = (
                          pixi: PIXI.Application,
                          fn: Counter,
                          interval: number,
                          repeat: boolean = false
                        Severity: Minor
                        Found in client/src/common/utils/tick.ts - About 1 hr to fix

                          Function init has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            init() {
                              let textures = this.model.app.loader.resources;
                              let base = {
                                model: this.model,
                                app: this.model.app
                          Severity: Minor
                          Found in client/src/models/map.ts - About 1 hr to fix

                            Function hueToRgb has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function hueToRgb(H: number) {
                              let S = config.hsv.saturation;
                              let V = config.hsv.value;
                              let C = V * S;
                              let Hp = H / 60;
                            Severity: Minor
                            Found in client/src/interfaces/gamemap.ts - About 1 hr to fix

                              Function default has a Cognitive Complexity of 11 (exceeds 5 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: Minor
                              Found in client/src/components/Password.tsx - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Severity
                              Category
                              Status
                              Source
                              Language