topfreegames/khan

View on GitHub

Showing 425 of 425 total issues

File membership_test.go has 2420 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// khan
// https://github.com/topfreegames/khan
//
// Licensed under the MIT license:
// http://www.opensource.org/licenses/mit-license
Severity: Major
Found in models/membership_test.go - About 6 days to fix

    File clan_test.go has 1393 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    // khan
    // https://github.com/topfreegames/khan
    //
    // Licensed under the MIT license:
    // http://www.opensource.org/licenses/mit-license
    Severity: Major
    Found in api/clan_test.go - About 2 days to fix

      File payload_easyjson.go has 1260 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
      
      package api
      
      import (
      Severity: Major
      Found in api/payload_easyjson.go - About 2 days to fix

        File clan_test.go has 1119 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        // khan
        // https://github.com/topfreegames/khan
        //
        // Licensed under the MIT license:
        // http://www.opensource.org/licenses/mit-license
        Severity: Major
        Found in models/clan_test.go - About 2 days to fix

          File membership_test.go has 994 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          // khan
          // https://github.com/topfreegames/khan
          //
          // Licensed under the MIT license:
          // http://www.opensource.org/licenses/mit-license
          Severity: Major
          Found in api/membership_test.go - About 1 day to fix

            File player_test.go has 892 lines of code (exceeds 500 allowed). Consider refactoring.
            Open

            // khan
            // https://github.com/topfreegames/khan
            //
            // Licensed under the MIT license:
            // http://www.opensource.org/licenses/mit-license
            Severity: Major
            Found in models/player_test.go - About 1 day to fix

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

                              It("Should call update clan hook if field in whitelist", func() {
                                  hooks, err := fixtures.GetHooksForRoutes(testDb, []string{
                                      "http://localhost:52525/clanupdatedhookwhitelist",
                                  }, models.ClanUpdatedHook)
                                  Expect(err).NotTo(HaveOccurred())
              Severity: Major
              Found in api/clan_test.go and 1 other location - About 1 day to fix
              api/clan_test.go on lines 1318..1374

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

              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

                              It("Should call update clan hook if field in whitelist is new", func() {
                                  hooks, err := fixtures.GetHooksForRoutes(testDb, []string{
                                      "http://localhost:52525/clanupdatedhookwhitelist3",
                                  }, models.ClanUpdatedHook)
                                  Expect(err).NotTo(HaveOccurred())
              Severity: Major
              Found in api/clan_test.go and 1 other location - About 1 day to fix
              api/clan_test.go on lines 1260..1316

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

              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 clan.go has 854 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              // khan
              // https://github.com/topfreegames/khan
              //
              // Licensed under the MIT license:
              // http://www.opensource.org/licenses/mit-license
              Severity: Major
              Found in models/clan.go - About 1 day to fix

                File clan.go has 740 lines of code (exceeds 500 allowed). Consider refactoring.
                Open

                // khan
                // https://github.com/topfreegames/khan
                //
                // Licensed under the MIT license:
                // http://www.opensource.org/licenses/mit-license
                Severity: Minor
                Found in api/clan.go - About 7 hrs to fix

                  File fixtures.go has 738 lines of code (exceeds 500 allowed). Consider refactoring.
                  Open

                  // khan
                  // https://github.com/topfreegames/khan
                  //
                  // Licensed under the MIT license:
                  // http://www.opensource.org/licenses/mit-license
                  Severity: Minor
                  Found in models/fixtures/fixtures.go - About 7 hrs to fix

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

                            It("should call membership denied hook on invitation", func() {
                                hooks, err := fixtures.GetHooksForRoutes(testDb, []string{
                                    "http://localhost:52525/membershipinvitationdenied",
                                }, models.MembershipDeniedHook)
                                Expect(err).NotTo(HaveOccurred())
                    Severity: Major
                    Found in api/membership_test.go and 1 other location - About 6 hrs to fix
                    api/membership_test.go on lines 1028..1065

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

                    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

                            It("should call membership approved hook on invitation", func() {
                                hooks, err := fixtures.GetHooksForRoutes(testDb, []string{
                                    "http://localhost:52525/membershipinvitationapproved",
                                }, models.MembershipApprovedHook)
                                Expect(err).NotTo(HaveOccurred())
                    Severity: Major
                    Found in api/membership_test.go and 1 other location - About 6 hrs to fix
                    api/membership_test.go on lines 1106..1143

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

                    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

                            It("should call membership approved hook on application", func() {
                                hooks, err := fixtures.GetHooksForRoutes(testDb, []string{
                                    "http://localhost:52525/membershipapplicationapproved",
                                }, models.MembershipApprovedHook)
                                Expect(err).NotTo(HaveOccurred())
                    Severity: Major
                    Found in api/membership_test.go and 1 other location - About 5 hrs to fix
                    api/membership_test.go on lines 1067..1104

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

                    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

                            It("should call membership denied hook on application", func() {
                                hooks, err := fixtures.GetHooksForRoutes(testDb, []string{
                                    "http://localhost:52525/membershipapplicationdenied",
                                }, models.MembershipDeniedHook)
                                Expect(err).NotTo(HaveOccurred())
                    Severity: Major
                    Found in api/membership_test.go and 1 other location - About 5 hrs to fix
                    api/membership_test.go on lines 989..1026

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

                    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 (app *App) connectDatabase() {
                        host := app.Config.GetString("postgres.host")
                        user := app.Config.GetString("postgres.user")
                        dbName := app.Config.GetString("postgres.dbname")
                        password := app.Config.GetString("postgres.password")
                    Severity: Major
                    Found in api/app.go and 1 other location - About 5 hrs to fix
                    services/encryption_script.go on lines 90..127

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

                    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 (app *EncryptionScript) connectDatabase() {
                        host := app.Config.GetString("postgres.host")
                        user := app.Config.GetString("postgres.user")
                        dbName := app.Config.GetString("postgres.dbname")
                        password := app.Config.GetString("postgres.password")
                    Severity: Major
                    Found in services/encryption_script.go and 1 other location - About 5 hrs to fix
                    api/app.go on lines 286..323

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

                    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 (p *CreateGamePayload) Validate() []string {
                        v := NewValidation()
                    
                        var minMembershipLevel int
                    
                    
                    Severity: Major
                    Found in api/payload.go and 1 other location - About 5 hrs to fix
                    api/payload.go on lines 186..226

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

                    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 (p *UpdateGamePayload) Validate() []string {
                        v := NewValidation()
                    
                        var minMembershipLevel int
                    
                    
                    Severity: Major
                    Found in api/payload.go and 1 other location - About 5 hrs to fix
                    api/payload.go on lines 247..287

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

                    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

                            It("should call membership promoted hook", func() {
                                hooks, err := fixtures.GetHooksForRoutes(testDb, []string{
                                    "http://localhost:52525/membershippromoted",
                                }, models.MembershipPromotedHook)
                                Expect(err).NotTo(HaveOccurred())
                    Severity: Major
                    Found in api/membership_test.go and 1 other location - About 5 hrs to fix
                    api/membership_test.go on lines 1221..1255

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

                    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