topfreegames/khan

View on GitHub

Showing 425 of 425 total issues

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

func (mr *MockKhanInterfaceMockRecorder) CreateClan(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateClan", reflect.TypeOf((*MockKhanInterface)(nil).CreateClan), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) ApproveDenyMembershipApplication(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApproveDenyMembershipApplication", reflect.TypeOf((*MockKhanInterface)(nil).ApproveDenyMembershipApplication), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) RetrieveClansSummary(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RetrieveClansSummary", reflect.TypeOf((*MockKhanInterface)(nil).RetrieveClansSummary), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) DeleteMembership(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMembership", reflect.TypeOf((*MockKhanInterface)(nil).DeleteMembership), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) PromoteDemote(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PromoteDemote", reflect.TypeOf((*MockKhanInterface)(nil).PromoteDemote), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) RetrieveClanSummary(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RetrieveClanSummary", reflect.TypeOf((*MockKhanInterface)(nil).RetrieveClanSummary), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) RetrievePlayer(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RetrievePlayer", reflect.TypeOf((*MockKhanInterface)(nil).RetrievePlayer), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) ApproveDenyMembershipInvitation(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApproveDenyMembershipInvitation", reflect.TypeOf((*MockKhanInterface)(nil).ApproveDenyMembershipInvitation), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) SearchClans(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchClans", reflect.TypeOf((*MockKhanInterface)(nil).SearchClans), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) LeaveClan(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaveClan", reflect.TypeOf((*MockKhanInterface)(nil).LeaveClan), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) RetrieveClan(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RetrieveClan", reflect.TypeOf((*MockKhanInterface)(nil).RetrieveClan), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) InviteForMembership(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InviteForMembership", reflect.TypeOf((*MockKhanInterface)(nil).InviteForMembership), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245
lib/mocks/khan.go on lines 272..275

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

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

func (mr *MockKhanInterfaceMockRecorder) UpdateClan(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClan", reflect.TypeOf((*MockKhanInterface)(nil).UpdateClan), arg0, arg1)
}
Severity: Major
Found in lib/mocks/khan.go and 13 other locations - About 45 mins to fix
lib/mocks/khan.go on lines 47..50
lib/mocks/khan.go on lines 62..65
lib/mocks/khan.go on lines 77..80
lib/mocks/khan.go on lines 92..95
lib/mocks/khan.go on lines 122..125
lib/mocks/khan.go on lines 137..140
lib/mocks/khan.go on lines 152..155
lib/mocks/khan.go on lines 167..170
lib/mocks/khan.go on lines 182..185
lib/mocks/khan.go on lines 197..200
lib/mocks/khan.go on lines 212..215
lib/mocks/khan.go on lines 227..230
lib/mocks/khan.go on lines 242..245

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

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 UpdatePlayerOwnershipCount(db DB, id int64) error {
    query := `
    UPDATE players SET ownership_count=ownership.count
    FROM (
        SELECT COUNT(*) as count
Severity: Minor
Found in models/player.go and 1 other location - About 40 mins to fix
models/player.go on lines 86..111

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

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 UpdatePlayerMembershipCount(db DB, id int64) error {
    query := `
    UPDATE players SET membership_count=membership.count
    FROM (
        SELECT COUNT(*) as count
Severity: Minor
Found in models/player.go and 1 other location - About 40 mins to fix
models/player.go on lines 114..137

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

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 CreateMembership has 6 return statements (exceeds 4 allowed).
Open

func CreateMembership(db DB, encryptionKey []byte, game *Game, gameID, level, playerPublicID, clanPublicID, requestorPublicID, message string) (*Membership, error) {
    if _, levelValid := game.MembershipLevels[level]; !levelValid {
        return nil, &InvalidLevelForGameError{gameID, level}
    }

Severity: Major
Found in models/membership.go - About 40 mins to fix

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

    func CreateTestClans(
        db models.DB, mongoDB interfaces.MongoDB, gameID string, publicIDTemplate string, numberOfClans int, afterCreationHook AfterClanCreationHook,
    ) (*models.Player, []*models.Clan, error) {
        if gameID == "" {
            gameID = uuid.NewV4().String()
    Severity: Major
    Found in models/fixtures/fixtures.go - About 40 mins to fix

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

      func UpdateClan(db DB, gameID, publicID, name, ownerPublicID string, metadata map[string]interface{}, allowApplication, autoJoin bool) (*Clan, error) {
          clan, err := GetClanByPublicIDAndOwnerPublicID(db, gameID, publicID, ownerPublicID)
          if err != nil {
              return nil, err
          }
      Severity: Major
      Found in models/clan.go - About 40 mins to fix

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

        func validateUpdatePlayerDispatch(game *models.Game, sourcePlayer *models.Player, player *models.Player, metadata map[string]interface{}, logger zap.Logger) bool {
            cl := logger.With(
                zap.String("playerUpdateMetadataFieldsHookTriggerWhitelist", game.PlayerUpdateMetadataFieldsHookTriggerWhitelist),
            )
        
        
        Severity: Major
        Found in api/player_helpers.go - About 40 mins to fix

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

          func DeleteMembership(db DB, game *Game, gameID, playerPublicID, clanPublicID, requestorPublicID string) (*Membership, error) {
              membership, err := GetValidMembershipByClanAndPlayerPublicID(db, gameID, clanPublicID, playerPublicID)
              if err != nil {
                  return nil, err
              }
          Severity: Major
          Found in models/membership.go - About 40 mins to fix
            Severity
            Category
            Status
            Source
            Language