yasshi2525/RushHour

View on GitHub

Showing 80 of 224 total issues

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

    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

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

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

                Method Auther.GetTwitterOAuthInfo has 5 return statements (exceeds 4 allowed).
                Open

                func (a *Auther) GetTwitterOAuthInfo(tmpCred *oauth.Credentials, tmpSecret string) (*OAuthInfo, error) {
                    cred, values, err := twitterClient.RequestToken(&http.Client{}, tmpCred, tmpSecret)
                    if err != nil {
                        return nil, err
                    }
                Severity: Major
                Found in auth/twitter.go - About 35 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return Object.assign({}, state, inOperation);
                  Severity: Major
                  Found in client/src/reducers/index.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return Object.assign({}, state, { inOperation });
                    Severity: Major
                    Found in client/src/reducers/index.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return Object.assign({}, state, { inPurge });
                      Severity: Major
                      Found in client/src/reducers/index.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return Object.assign({}, state, { players });
                        Severity: Major
                        Found in client/src/reducers/index.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return Object.assign({}, state, { inOperation });
                          Severity: Major
                          Found in client/src/reducers/index.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return Object.assign({}, state, { inPurge });
                            Severity: Major
                            Found in client/src/reducers/index.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return Object.assign({}, state, { players });
                              Severity: Major
                              Found in client/src/reducers/index.ts - About 30 mins to fix

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

                                export default function() {
                                  const theme = useTheme();
                                  const classes = useStyles(theme);
                                  const isTiny = useMediaQuery(theme.breakpoints.down("xs"));
                                  const [, update] = useContext(LoadingContext);
                                Severity: Minor
                                Found in client/src/components/AppBar.tsx - About 25 mins 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 makeCube has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const makeCube = (dlg: number, length: number) => {
                                  const buffer: Chunk[] = [];
                                  for (let i = 0; i <= length; i++) {
                                    for (let j = 0; j <= length; j++) {
                                      for (let k = 0; k <= length; k++) {
                                Severity: Minor
                                Found in client/src/common/utils/map_chunk.ts - About 25 mins 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 useMultiTask has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const useMultiTask = <I, O>(
                                  task: Task<I, O>,
                                  handlers?: MultiTaskHandler<I, O>
                                ): Handlers<I> => {
                                  const [, maintain] = useContext(OperationContext);
                                Severity: Minor
                                Found in client/src/common/utils/task_multi.ts - About 25 mins 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 merge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  merge(key: string, value: any) {
                                    if (!this.equals(key, value)) {
                                      if (!(value instanceof Object)) {
                                        this.props[key] = value;
                                      } else {
                                Severity: Minor
                                Found in client/src/models/base.ts - About 25 mins 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 http has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export async function http(
                                  url: string,
                                  method: Method = Method.GET,
                                  params: { [index: string]: any } = {}
                                ) {
                                Severity: Minor
                                Found in client/src/sagas/index.ts - About 25 mins 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