topfreegames/khan

View on GitHub

Showing 425 of 425 total issues

Function easyjsonA8a797f8DecodeGithubComTopfreegamesKhanApi8 has 95 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func easyjsonA8a797f8DecodeGithubComTopfreegamesKhanApi8(in *jlexer.Lexer, out *CreateGamePayload) {
    isTopLevel := in.IsStart()
    if in.IsNull() {
        if isTopLevel {
            in.Consumed()
Severity: Major
Found in api/payload_easyjson.go - About 2 hrs to fix

    Function CreateGame has 95 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func CreateGame(
        db DB,
        publicID, name string,
        levels, metadata map[string]interface{},
        minLevelAccept, minLevelCreate, minLevelRemove,
    Severity: Major
    Found in models/game.go - About 2 hrs to fix

      Function RetrieveClanHandler has 94 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func RetrieveClanHandler(app *App) func(c echo.Context) error {
          return func(c echo.Context) error {
              c.Set("route", "RetrieveClan")
              start := time.Now()
              gameID := c.Param("gameID")
      Severity: Major
      Found in api/clan.go - About 2 hrs to fix

        Function ApproveOrDenyMembershipInvitationHandler has 93 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func ApproveOrDenyMembershipInvitationHandler(app *App) func(c echo.Context) error {
            return func(c echo.Context) error {
                var membership *models.Membership
                var err error
                var tx interfaces.Transaction
        Severity: Major
        Found in api/membership.go - About 2 hrs to fix

          Function InviteForMembershipHandler has 93 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func InviteForMembershipHandler(app *App) func(c echo.Context) error {
              return func(c echo.Context) error {
                  var payload InviteForMembershipPayload
                  var optional *membershipOptionalParams
                  var err error
          Severity: Major
          Found in api/membership.go - About 2 hrs to fix

            Function easyjsonA8a797f8DecodeGithubComTopfreegamesKhanApi2 has 93 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func easyjsonA8a797f8DecodeGithubComTopfreegamesKhanApi2(in *jlexer.Lexer, out *UpdateGamePayload) {
                isTopLevel := in.IsStart()
                if in.IsNull() {
                    if isTopLevel {
                        in.Consumed()
            Severity: Major
            Found in api/payload_easyjson.go - About 2 hrs to fix

              Function ApplyForMembershipHandler has 93 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func ApplyForMembershipHandler(app *App) func(c echo.Context) error {
                  return func(c echo.Context) error {
                      c.Set("route", "ApplyForMembership")
                      start := time.Now()
                      gameID := c.Param("gameID")
              Severity: Major
              Found in api/membership.go - About 2 hrs to fix

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

                func easyjsonA8a797f8DecodeGithubComTopfreegamesKhanApi11(in *jlexer.Lexer, out *ApproveOrDenyMembershipInvitationPayload) {
                    isTopLevel := in.IsStart()
                    if in.IsNull() {
                        if isTopLevel {
                            in.Consumed()
                Severity: Major
                Found in api/payload_easyjson.go and 1 other location - About 2 hrs to fix
                api/payload_easyjson.go on lines 508..538

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

                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

                func easyjsonA8a797f8DecodeGithubComTopfreegamesKhanApi4(in *jlexer.Lexer, out *TransferClanOwnershipPayload) {
                    isTopLevel := in.IsStart()
                    if in.IsNull() {
                        if isTopLevel {
                            in.Consumed()
                Severity: Major
                Found in api/payload_easyjson.go and 1 other location - About 2 hrs to fix
                api/payload_easyjson.go on lines 1208..1238

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

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

                        case "metadata":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 838..859
                api/payload_easyjson.go on lines 1045..1066
                models/clan_easyjson.go on lines 51..72

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

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

                        case "membershipLevels":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 838..859
                api/payload_easyjson.go on lines 1045..1066
                models/clan_easyjson.go on lines 51..72

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

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

                        case "metadata":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 838..859
                models/clan_easyjson.go on lines 51..72

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

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

                        case "metadata":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 838..859
                api/payload_easyjson.go on lines 1045..1066
                models/clan_easyjson.go on lines 51..72

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

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

                        case "metadata":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 838..859
                api/payload_easyjson.go on lines 1045..1066
                models/clan_easyjson.go on lines 51..72

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

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

                        case "metadata":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 1045..1066
                models/clan_easyjson.go on lines 51..72

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

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

                        case "membershipLevels":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 838..859
                api/payload_easyjson.go on lines 1045..1066
                models/clan_easyjson.go on lines 51..72

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

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

                        case "metadata":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in models/clan_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 86..107
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 838..859
                api/payload_easyjson.go on lines 1045..1066

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

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

                        case "metadata":
                            if in.IsNull() {
                                in.Skip()
                            } else {
                                in.Delim('{')
                Severity: Major
                Found in api/payload_easyjson.go and 8 other locations - About 2 hrs to fix
                api/payload_easyjson.go on lines 187..208
                api/payload_easyjson.go on lines 209..230
                api/payload_easyjson.go on lines 409..430
                api/payload_easyjson.go on lines 708..729
                api/payload_easyjson.go on lines 816..837
                api/payload_easyjson.go on lines 838..859
                api/payload_easyjson.go on lines 1045..1066
                models/clan_easyjson.go on lines 51..72

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

                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

                                It("If requestor membership is denied", func() {
                                    game, clan, _, players, memberships, err := fixtures.GetClanWithMemberships(testDb, 0, 0, 0, 2, "", "")
                                    Expect(err).NotTo(HaveOccurred())
                
                                    memberships[1].Level = "CoLeader"
                Severity: Major
                Found in models/membership_test.go and 2 other locations - About 2 hrs to fix
                models/membership_test.go on lines 2806..2825
                models/membership_test.go on lines 2887..2906

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

                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

                                It("If requestor membership is not approved", func() {
                                    game, clan, _, players, memberships, err := fixtures.GetClanWithMemberships(testDb, 0, 0, 0, 2, "", "")
                                    Expect(err).NotTo(HaveOccurred())
                
                                    memberships[1].Level = "CoLeader"
                Severity: Major
                Found in models/membership_test.go and 2 other locations - About 2 hrs to fix
                models/membership_test.go on lines 2806..2825
                models/membership_test.go on lines 2866..2885

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

                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