piotrkowalczuk/charon

View on GitHub

Showing 70 of 141 total issues

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

package charond

import (
    "context"

Severity: Major
Found in internal/charond/handler_set_group_permissions.go and 1 other location - About 7 hrs to fix
internal/charond/handler_set_user_permissions.go on lines 1..67

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

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

package charond

import (
    "context"

Severity: Major
Found in internal/charond/handler_set_user_permissions.go and 1 other location - About 7 hrs to fix
internal/charond/handler_set_group_permissions.go on lines 1..66

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

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 (_m *UserProvider) SetPermissions(ctx context.Context, id int64, permissions ...charon.Permission) (int64, int64, error) {
    _va := make([]interface{}, len(permissions))
    for _i := range permissions {
        _va[_i] = permissions[_i]
    }
Severity: Major
Found in internal/model/modelmock/user_provider.go and 1 other location - About 6 hrs to fix
internal/model/modelmock/group_provider.go on lines 174..206

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

func (_m *GroupProvider) SetPermissions(_a0 context.Context, _a1 int64, _a2 ...charon.Permission) (int64, int64, error) {
    _va := make([]interface{}, len(_a2))
    for _i := range _a2 {
        _va[_i] = _a2[_i]
    }
Severity: Major
Found in internal/model/modelmock/group_provider.go and 1 other location - About 6 hrs to fix
internal/model/modelmock/user_provider.go on lines 273..305

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

func (_m *PermissionProvider) Register(ctx context.Context, permissions charon.Permissions) (int64, int64, int64, error) {
    ret := _m.Called(ctx, permissions)

    var r0 int64
    if rf, ok := ret.Get(0).(func(context.Context, charon.Permissions) int64); ok {
Severity: Major
Found in internal/model/modelmock/permission_provider.go and 1 other location - About 5 hrs to fix
internal/model/modelmock/permission_registry.go on lines 29..61

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

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 (_m *PermissionRegistry) Register(ctx context.Context, permissions charon.Permissions) (int64, int64, int64, error) {
    ret := _m.Called(ctx, permissions)

    var r0 int64
    if rf, ok := ret.Get(0).(func(context.Context, charon.Permissions) int64); ok {
Severity: Major
Found in internal/model/modelmock/permission_registry.go and 1 other location - About 5 hrs to fix
internal/model/modelmock/permission_provider.go on lines 152..184

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

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

func (_m *RefreshTokenProvider) UpdateOneByToken(_a0 context.Context, _a1 string, _a2 *model.RefreshTokenPatch) (*model.RefreshTokenEntity, error) {
    ret := _m.Called(_a0, _a1, _a2)

    var r0 *model.RefreshTokenEntity
    if rf, ok := ret.Get(0).(func(context.Context, string, *model.RefreshTokenPatch) *model.RefreshTokenEntity); ok {
Severity: Major
Found in internal/model/modelmock/refresh_token_provider.go and 2 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 209..229
internal/model/modelmock/user_provider.go on lines 329..349

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

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

func (_m *GroupProvider) UpdateOneByID(_a0 context.Context, _a1 int64, _a2 *model.GroupPatch) (*model.GroupEntity, error) {
    ret := _m.Called(_a0, _a1, _a2)

    var r0 *model.GroupEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64, *model.GroupPatch) *model.GroupEntity); ok {
Severity: Major
Found in internal/model/modelmock/group_provider.go and 2 other locations - About 3 hrs to fix
internal/model/modelmock/refresh_token_provider.go on lines 107..127
internal/model/modelmock/user_provider.go on lines 329..349

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

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

func (_m *UserProvider) UpdateOneByID(_a0 context.Context, _a1 int64, _a2 *model.UserPatch) (*model.UserEntity, error) {
    ret := _m.Called(_a0, _a1, _a2)

    var r0 *model.UserEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64, *model.UserPatch) *model.UserEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 2 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 209..229
internal/model/modelmock/refresh_token_provider.go on lines 107..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 302.

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

func (_m *RefreshTokenProvider) Find(_a0 context.Context, _a1 *model.RefreshTokenFindExpr) ([]*model.RefreshTokenEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 []*model.RefreshTokenEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.RefreshTokenFindExpr) []*model.RefreshTokenEntity); ok {
Severity: Major
Found in internal/model/modelmock/refresh_token_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 61..81
internal/model/modelmock/permission_provider.go on lines 16..36
internal/model/modelmock/user_groups_provider.go on lines 57..77
internal/model/modelmock/user_provider.go on lines 139..159

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

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

func (_m *UserGroupsProvider) Find(ctx context.Context, expr *model.UserGroupsFindExpr) ([]*model.UserGroupsEntity, error) {
    ret := _m.Called(ctx, expr)

    var r0 []*model.UserGroupsEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.UserGroupsFindExpr) []*model.UserGroupsEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_groups_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 61..81
internal/model/modelmock/permission_provider.go on lines 16..36
internal/model/modelmock/refresh_token_provider.go on lines 38..58
internal/model/modelmock/user_provider.go on lines 139..159

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

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

func (_m *GroupProvider) Find(_a0 context.Context, _a1 *model.GroupFindExpr) ([]*model.GroupEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 []*model.GroupEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.GroupFindExpr) []*model.GroupEntity); ok {
Severity: Major
Found in internal/model/modelmock/group_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/permission_provider.go on lines 16..36
internal/model/modelmock/refresh_token_provider.go on lines 38..58
internal/model/modelmock/user_groups_provider.go on lines 57..77
internal/model/modelmock/user_provider.go on lines 139..159

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

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

func (_m *UserProvider) Find(_a0 context.Context, _a1 *model.UserFindExpr) ([]*model.UserEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 []*model.UserEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.UserFindExpr) []*model.UserEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 61..81
internal/model/modelmock/permission_provider.go on lines 16..36
internal/model/modelmock/refresh_token_provider.go on lines 38..58
internal/model/modelmock/user_groups_provider.go on lines 57..77

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

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

func (_m *PermissionProvider) Find(ctx context.Context, criteria *model.PermissionFindExpr) ([]*model.PermissionEntity, error) {
    ret := _m.Called(ctx, criteria)

    var r0 []*model.PermissionEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.PermissionFindExpr) []*model.PermissionEntity); ok {
Severity: Major
Found in internal/model/modelmock/permission_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 61..81
internal/model/modelmock/refresh_token_provider.go on lines 38..58
internal/model/modelmock/user_groups_provider.go on lines 57..77
internal/model/modelmock/user_provider.go on lines 139..159

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

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

func (_m *UserPermissionsProvider) Insert(_a0 context.Context, _a1 *model.UserPermissionsEntity) (*model.UserPermissionsEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.UserPermissionsEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.UserPermissionsEntity) *model.UserPermissionsEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_permissions_provider.go and 7 other locations - About 3 hrs to fix
internal/model/modelmock/group_permissions_provider.go on lines 15..35
internal/model/modelmock/group_provider.go on lines 130..150
internal/model/modelmock/permission_provider.go on lines 108..128
internal/model/modelmock/refresh_token_provider.go on lines 15..35
internal/model/modelmock/user_groups_provider.go on lines 80..100
internal/model/modelmock/user_provider.go on lines 51..71
internal/model/modelmock/user_provider.go on lines 208..228

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

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

func (_m *UserProvider) Insert(_a0 context.Context, _a1 *model.UserEntity) (*model.UserEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.UserEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.UserEntity) *model.UserEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 7 other locations - About 3 hrs to fix
internal/model/modelmock/group_permissions_provider.go on lines 15..35
internal/model/modelmock/group_provider.go on lines 130..150
internal/model/modelmock/permission_provider.go on lines 108..128
internal/model/modelmock/refresh_token_provider.go on lines 15..35
internal/model/modelmock/user_groups_provider.go on lines 80..100
internal/model/modelmock/user_permissions_provider.go on lines 36..56
internal/model/modelmock/user_provider.go on lines 51..71

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

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

func (_m *RefreshTokenProvider) Create(_a0 context.Context, _a1 *model.RefreshTokenEntity) (*model.RefreshTokenEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.RefreshTokenEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.RefreshTokenEntity) *model.RefreshTokenEntity); ok {
Severity: Major
Found in internal/model/modelmock/refresh_token_provider.go and 7 other locations - About 3 hrs to fix
internal/model/modelmock/group_permissions_provider.go on lines 15..35
internal/model/modelmock/group_provider.go on lines 130..150
internal/model/modelmock/permission_provider.go on lines 108..128
internal/model/modelmock/user_groups_provider.go on lines 80..100
internal/model/modelmock/user_permissions_provider.go on lines 36..56
internal/model/modelmock/user_provider.go on lines 51..71
internal/model/modelmock/user_provider.go on lines 208..228

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

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

func (_m *UserGroupsProvider) Insert(ctx context.Context, ent *model.UserGroupsEntity) (*model.UserGroupsEntity, error) {
    ret := _m.Called(ctx, ent)

    var r0 *model.UserGroupsEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.UserGroupsEntity) *model.UserGroupsEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_groups_provider.go and 7 other locations - About 3 hrs to fix
internal/model/modelmock/group_permissions_provider.go on lines 15..35
internal/model/modelmock/group_provider.go on lines 130..150
internal/model/modelmock/permission_provider.go on lines 108..128
internal/model/modelmock/refresh_token_provider.go on lines 15..35
internal/model/modelmock/user_permissions_provider.go on lines 36..56
internal/model/modelmock/user_provider.go on lines 51..71
internal/model/modelmock/user_provider.go on lines 208..228

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

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

func (_m *GroupPermissionsProvider) Insert(_a0 context.Context, _a1 *model.GroupPermissionsEntity) (*model.GroupPermissionsEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.GroupPermissionsEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.GroupPermissionsEntity) *model.GroupPermissionsEntity); ok {
Severity: Major
Found in internal/model/modelmock/group_permissions_provider.go and 7 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 130..150
internal/model/modelmock/permission_provider.go on lines 108..128
internal/model/modelmock/refresh_token_provider.go on lines 15..35
internal/model/modelmock/user_groups_provider.go on lines 80..100
internal/model/modelmock/user_permissions_provider.go on lines 36..56
internal/model/modelmock/user_provider.go on lines 51..71
internal/model/modelmock/user_provider.go on lines 208..228

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

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

func (_m *UserProvider) Create(_a0 context.Context, _a1 *model.UserEntity) (*model.UserEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.UserEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.UserEntity) *model.UserEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 7 other locations - About 3 hrs to fix
internal/model/modelmock/group_permissions_provider.go on lines 15..35
internal/model/modelmock/group_provider.go on lines 130..150
internal/model/modelmock/permission_provider.go on lines 108..128
internal/model/modelmock/refresh_token_provider.go on lines 15..35
internal/model/modelmock/user_groups_provider.go on lines 80..100
internal/model/modelmock/user_permissions_provider.go on lines 36..56
internal/model/modelmock/user_provider.go on lines 208..228

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

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