Preparing report...

Report for github.com/reubenmiller/go-c8y

A+    Excellent!    Found 14 issues across 78 files

Tweet

gofmt98%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo93%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • go-c8y/pkg/c8y/client.go
    • Line 306: warning: cyclomatic complexity 25 of function (*Client).SendRequest() is high (> 15) (gocyclo)
    • Line 430: warning: cyclomatic complexity 24 of function (*Client).SetJSONItems() is high (> 15) (gocyclo)
    • Line 614: warning: cyclomatic complexity 17 of function (*Client).Do() is high (> 15) (gocyclo)

golint87%

Golint is a linter for Go source code.

    • go-c8y/pkg/matcher/matcher.go
    • Line 9: warning: exported function MatchWithWildcards should have comment or be unexported (golint)
    • Line 28: warning: exported function MatchWithRegex should have comment or be unexported (golint)
    • go-c8y/pkg/encrypt/encrypt.go
    • Line 20: warning: exported function EncryptString should have comment or be unexported (golint)
    • Line 24: warning: exported function DecryptString should have comment or be unexported (golint)
    • Line 28: warning: exported function Encrypt should have comment or be unexported (golint)
    • Line 42: warning: exported function Decrypt should have comment or be unexported (golint)
    • Line 61: warning: exported function EncryptFile should have comment or be unexported (golint)
    • Line 67: warning: exported function DecryptFile should have comment or be unexported (golint)
    • go-c8y/pkg/c8y/user.go
    • Line 51: warning: exported method User.SetFirstName should have comment or be unexported (golint)
    • Line 56: warning: exported method User.SetLastName should have comment or be unexported (golint)
    • Line 61: warning: exported method User.SetEmail should have comment or be unexported (golint)
    • Line 66: warning: exported method User.SetPhone should have comment or be unexported (golint)
    • Line 71: warning: exported method User.SetEnabled should have comment or be unexported (golint)
    • Line 92: warning: exported type RoleReferenceCollection should have comment or be unexported (golint)
    • Line 97: warning: exported type RoleReference should have comment or be unexported (golint)
    • Line 102: warning: exported type Role should have comment or be unexported (golint)
    • Line 108: warning: exported type Group should have comment or be unexported (golint)
    • Line 223: warning: exported type UserReferenceCollection should have comment or be unexported (golint)
    • Line 230: warning: exported type UserReference should have comment or be unexported (golint)
    • Line 235: warning: exported type GroupReferenceCollection should have comment or be unexported (golint)
    • Line 281: warning: exported type GroupCollection should have comment or be unexported (golint)
    • Line 415: warning: exported method UserService.AssignRoleToUser should have comment or be unexported (golint)
    • go-c8y/pkg/jsonUtilities/json.go
    • Line 1: warning: don't use MixedCaps in package name; jsonUtilities should be jsonutilities (golint)
    • Line 47: warning: exported type JsonDecodeError should have comment or be unexported (golint)
    • Line 51: warning: exported var ErrOpenFile should have comment or be unexported (golint)
    • Line 52: warning: exported var ErrJSONDecode should have comment or be unexported (golint)
    • Line 53: warning: exported var ErrReadFile should have comment or be unexported (golint)
    • go-c8y/pkg/mapbuilder/mapbuilder.go
    • Line 15: warning: exported const Separator should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: exported function NewMapBuilder should have comment or be unexported (golint)
    • Line 69: warning: exported function NewMapBuilderWithInit should have comment or be unexported (golint)
    • Line 141: warning: comment on exported method MapBuilder.Get should be of the form "Get ..." (golint)
    • Line 146: warning: comment on exported method MapBuilder.GetString should be of the form "GetString ..." (golint)
    • go-c8y/pkg/c8y/tenant.go
    • Line 16: warning: exported type TenantStatisticsOptions should have comment or be unexported (golint)
    • Line 36: warning: exported type TenantUsageStatisticsCollection should have comment or be unexported (golint)
    • Line 49: warning: exported type TenantUsageStatisticsSummary should have comment or be unexported (golint)
    • Line 59: warning: exported type TenantUsageStatisticsSummaryExtended should have comment or be unexported (golint)
    • Line 135: warning: exported type ApplicationReferenceCollection should have comment or be unexported (golint)
    • Line 177: warning: exported type ApplicationReference should have comment or be unexported (golint)
    • go-c8y/pkg/logger/logger.go
    • Line 7: warning: exported type NopBackend should have comment or be unexported (golint)
    • Line 10: warning: exported method NopBackend.Log should have comment or be unexported (golint)
    • Line 15: warning: exported method NopBackend.GetLevel should have comment or be unexported (golint)
    • Line 19: warning: exported method NopBackend.SetLevel should have comment or be unexported (golint)
    • Line 20: warning: exported method NopBackend.IsEnabledFor should have comment or be unexported (golint)
    • Line 24: warning: exported type Logger should have comment or be unexported (golint)
    • Line 28: warning: exported method Logger.Printf should have comment or be unexported (golint)
    • Line 32: warning: exported method Logger.Println should have comment or be unexported (golint)
    • Line 36: warning: exported function NewDummyLogger should have comment or be unexported (golint)
    • Line 44: warning: exported function NewLogger should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!