Preparing report...

Report for github.com/TeaEntityLab/go-web-app

A+    Excellent!    Found 48 issues across 61 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo91%

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.


golint27%

Golint is a linter for Go source code.

    • go-web-app/common/util/objutils/common.go
    • Line 11: warning: exported function IsInstanceOf should have comment or be unexported (golint)
    • Line 15: warning: exported function ReplaceFormat should have comment or be unexported (golint)
    • Line 25: warning: exported function DeduplicateStringSlice should have comment or be unexported (golint)
    • Line 40: warning: exported function ValidateEmail should have comment or be unexported (golint)
    • Line 45: warning: exported function IsASCII should have comment or be unexported (golint)
    • Line 54: warning: exported function StrOrDefault should have comment or be unexported (golint)
    • go-web-app/db/migration/common.go
    • Line 23: warning: exported const AutogenEndOfFile should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported function GetMigrationFileName should have comment or be unexported (golint)
    • Line 29: warning: exported function GetMigrationAutoGenFileName should have comment or be unexported (golint)
    • Line 32: warning: exported function GetMigrationListForAutoGen should have comment or be unexported (golint)
    • Line 61: warning: exported function GenerateMigrationAutogenFile should have comment or be unexported (golint)
    • Line 81: warning: exported function Migrate should have comment or be unexported (golint)
    • Line 100: warning: exported function MigrateRollback should have comment or be unexported (golint)
    • go-web-app/common/model/Role.go
    • Line 3: warning: exported type Role should have comment or be unexported (golint)
    • Line 30: warning: exported type CachedPermissionEntry should have comment or be unexported (golint)
    • Line 39: warning: exported type CachedPermission should have comment or be unexported (golint)
    • go-web-app/db/redis.go
    • Line 13: warning: exported function ParseRedisConnectionString should have comment or be unexported (golint)
    • Line 33: warning: exported function NewRedisClient should have comment or be unexported (golint)
    • Line 77: warning: comment on exported function CheckRedisNotExistError should be of the form "CheckRedisNotExistError ..." (golint)
    • Line 85: warning: exported type RedisHashring should have comment or be unexported (golint)
    • Line 91: warning: exported function NewRedisHashring should have comment or be unexported (golint)
    • Line 109: warning: exported method RedisHashring.GetNode should have comment or be unexported (golint)
    • go-web-app/common/util/netutils/dns.go
    • Line 10: warning: exported const DNS_TRAILING_DOT should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported function GetCNameByDomainName should have comment or be unexported (golint)
    • go-web-app/db/common.go
    • Line 14: warning: exported var Logger should have comment or be unexported (golint)
    • Line 17: warning: exported type CommonConfig should have comment or be unexported (golint)
    • Line 22: warning: exported function InitDefaultDatabase should have comment or be unexported (golint)
    • Line 49: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 54: warning: exported function GetDefaultDatabase should have comment or be unexported (golint)
    • go-web-app/common/service/permission/checker.go
    • Line 1: warning: don't use MixedCaps in package name; servicePermission should be servicepermission (golint)
    • Line 11: warning: exported type UserPermissionRequestInfo should have comment or be unexported (golint)
    • Line 19: warning: exported type UserPermissionGrantedInfo should have comment or be unexported (golint)
    • go-web-app/app/route/common.go
    • Line 16: warning: exported const COMMON_RESPONSE_CODE_SUCCESS should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: exported var Logger should have comment or be unexported (golint)
    • Line 48: warning: exported type CommonResponse should have comment or be unexported (golint)
    • Line 57: warning: exported type CommonErrorResponse should have comment or be unexported (golint)
    • go-web-app/common/util/gormutils/query.go
    • Line 11: warning: exported function GetModelCommonQuery should have comment or be unexported (golint)
    • Line 30: warning: exported function GetQueryWithPagination should have comment or be unexported (golint)
    • Line 34: warning: exported function GetQueryWhereIn should have comment or be unexported (golint)
    • Line 43: warning: exported function GetQueryWhereInInterfaceValues should have comment or be unexported (golint)
    • Line 47: warning: exported function GetQueryWithSelectSubItemCount should have comment or be unexported (golint)
    • Line 58: warning: exported function GetQueryWithSelectSubItemCountSQLString should have comment or be unexported (golint)
    • go-web-app/common/model/common.go
    • Line 14: warning: exported type Loggable should have comment or be unexported (golint)
    • Line 19: warning: exported type CachedEntry should have comment or be unexported (golint)
    • Line 23: warning: exported method CachedEntry.GetCreatedTime should have comment or be unexported (golint)
    • Line 27: warning: exported type HTTPRequestInfo should have comment or be unexported (golint)
    • Line 38: warning: exported type BaseModel should have comment or be unexported (golint)
    • Line 45: warning: exported type BaseModelForJoin should have comment or be unexported (golint)
    • go-web-app/common/util/timeutils/common.go
    • Line 10: warning: exported const TimeFormatLayoutDateYYYYMMDDByDash should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported var TimeFormatLayoutDateYYYYMMDDSeries should have comment or be unexported (golint)
    • Line 29: warning: exported function GetTimestamp should have comment or be unexported (golint)
    • Line 33: warning: exported function GetTimestampString should have comment or be unexported (golint)
    • Line 37: warning: exported function GetRFC3339StringForCodeGen should have comment or be unexported (golint)
    • Line 45: warning: exported function GetRFC3339String should have comment or be unexported (golint)
    • Line 54: warning: exported function GetDateYYYYMMDDByDashString should have comment or be unexported (golint)
    • Line 63: warning: exported function Bod should have comment or be unexported (golint)
    • Line 68: warning: exported function TruncateByDuration should have comment or be unexported (golint)
    • Line 72: warning: exported function TruncateByHour should have comment or be unexported (golint)
    • Line 76: warning: exported function TruncateByDay should have comment or be unexported (golint)
    • go-web-app/common/repository/common.go
    • Line 20: warning: exported type Repository should have comment or be unexported (golint)
    • Line 23: warning: exported type TextSearchableRepository should have comment or be unexported (golint)
    • Line 27: warning: exported type SortOrder should have comment or be unexported (golint)
    • Line 30: warning: don't use underscores in Go names; const SortOrder_DESC should be SortOrderDESC (golint)
    • Line 30: warning: exported const SortOrder_DESC should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: don't use underscores in Go names; const SortOrder_ASC should be SortOrderASC (golint)
    • Line 34: warning: don't use underscores in Go names; var SortOrder_name should be SortOrderName (golint)
    • Line 34: warning: exported var SortOrder_name should have comment or be unexported (golint)
    • Line 38: warning: don't use underscores in Go names; var SortOrder_value should be SortOrderValue (golint)
    • Line 38: warning: exported var SortOrder_value should have comment or be unexported (golint)
    • Line 43: warning: exported method SortOrder.Enum should have comment or be unexported (golint)
    • Line 51: warning: exported method SortOrder.UnmarshalJSON should have comment or be unexported (golint)
    • Line 64: warning: exported function NewSortOrderByString should have comment or be unexported (golint)
    • Line 73: warning: exported type SortField should have comment or be unexported (golint)
    • Line 76: warning: don't use underscores in Go names; const SortField_created_at should be SortFieldCreatedAt (golint)
    • Line 76: warning: exported const SortField_created_at should have comment (or a comment on this block) or be unexported (golint)
    • Line 77: warning: don't use underscores in Go names; const SortField_updated_at should be SortFieldUpdatedAt (golint)
    • Line 80: warning: don't use underscores in Go names; var SortField_name should be SortFieldName (golint)
    • Line 80: warning: exported var SortField_name should have comment or be unexported (golint)
    • Line 84: warning: don't use underscores in Go names; var SortField_value should be SortFieldValue (golint)
    • Line 84: warning: exported var SortField_value should have comment or be unexported (golint)
    • Line 89: warning: exported method SortField.Enum should have comment or be unexported (golint)
    • Line 97: warning: exported method SortField.UnmarshalJSON should have comment or be unexported (golint)
    • Line 110: warning: exported function NewSortFieldByString should have comment or be unexported (golint)
    • Line 120: warning: exported var ConnectionDuration should have comment or be unexported (golint)
    • Line 127: warning: comment on exported var ErrBadRequest should be of the form "ErrBadRequest ..." (golint)
    • Line 137: warning: exported const InvalidPageIndex should have comment (or a comment on this block) or be unexported (golint)
    • Line 139: warning: comment on exported const UUIDFieldName should be of the form "UUIDFieldName ..." (golint)
    • Line 191: warning: exported function GetContextWithTimeoutFromConnectionDurationCommon should have comment or be unexported (golint)
    • Line 195: warning: exported function NewBackgroundContextWithTimeout should have comment or be unexported (golint)
    • Line 200: warning: exported function NewBackgroundContextWithDefaultTimeout should have comment or be unexported (golint)
    • Line 204: warning: exported function Init should have comment or be unexported (golint)
    • Line 218: warning: exported function InitCacheWithSize should have comment or be unexported (golint)
    • Line 222: warning: exported function InitCacheWithSizeAndExpiration should have comment or be unexported (golint)
    • Line 234: warning: exported function SetDebug should have comment or be unexported (golint)
    • go-web-app/thirdparty/jsondiff/jsondiff.go
    • Line 13: warning: exported type Difference should have comment or be unexported (golint)
    • Line 16: warning: exported const FullMatch should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported type Tag should have comment or be unexported (golint)
    • Line 51: warning: exported type Options should have comment or be unexported (golint)
    • Line 65: warning: comment on exported function DefaultJSONOptions should be of the form "DefaultJSONOptions ..." (golint)
    • Line 76: warning: comment on exported function DefaultConsoleOptions should be of the form "DefaultConsoleOptions ..." (golint)
    • Line 88: warning: comment on exported function DefaultHTMLOptions should be of the form "DefaultHTMLOptions ..." (golint)
    • Line 111: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 394: warning: comment on exported function Compare should be of the form "Compare ..." (golint)
    • go-web-app/db/seeder/common.go
    • Line 18: warning: exported type Seeder should have comment or be unexported (golint)
    • Line 30: warning: exported const AutogenEndOfFile should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported function GetSeederFileName should have comment or be unexported (golint)
    • Line 36: warning: exported function GetSeederAutoGenFileName should have comment or be unexported (golint)
    • Line 39: warning: exported function GetSeederListForAutoGen should have comment or be unexported (golint)
    • Line 68: warning: exported function GenerateSeederAutogenFile should have comment or be unexported (golint)
    • Line 88: warning: exported function SeedBySeederName should have comment or be unexported (golint)
    • Line 113: warning: exported function SeedAll should have comment or be unexported (golint)
    • go-web-app/common/service/permission/common.go
    • Line 1: warning: don't use MixedCaps in package name; servicePermission should be servicepermission (golint)
    • Line 35: warning: exported var DebugMode should have comment or be unexported (golint)
    • Line 43: warning: exported function InitCacheWithSize should have comment or be unexported (golint)
    • Line 95: warning: exported function CleanPermissionsByUserIDToMemCache should have comment or be unexported (golint)
    • go-web-app/common/repository/cache.go
    • Line 21: warning: exported type CacheStore should have comment or be unexported (golint)
    • Line 36: warning: exported function NewCacheStoreWithRedisClient should have comment or be unexported (golint)
    • Line 63: warning: comment on exported method CacheStore.Set should be of the form "Set ..." (golint)
    • Line 70: warning: comment on exported method CacheStore.SetWithTTL should be of the form "SetWithTTL ..." (golint)
    • go-web-app/common/repository/userRepository.go
    • Line 56: warning: exported method UserRepository.EnsureRoles should have comment or be unexported (golint)
    • Line 135: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 145: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 172: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-web-app/common/util/httputils/request.go
    • Line 17: warning: exported function GetHttpRequestInfo should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function NewHttpLogger should be of the form "NewHttpLogger ..." (golint)
    • Line 132: warning: exported function GetBearerAuthTokenString should have comment or be unexported (golint)
    • Line 140: warning: exported function CheckLoginStatusOrAbort should have comment or be unexported (golint)
    • go-web-app/common/route/common.go
    • Line 19: warning: exported type CachedOrganizationInfoForPermission should have comment or be unexported (golint)
    • Line 63: warning: exported var AccessControlAllowMethods should have comment or be unexported (golint)
    • Line 85: warning: exported function SimpleCORSMiddleware should have comment or be unexported (golint)
    • go-web-app/db/seeder/seeder_2021_04_14T06_10_33Z_General_UserSeeder.go
    • Line 14: warning: exported const USER_NAME_ADMIN should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type UserSeeder should have comment or be unexported (golint)
    • Line 19: warning: exported method UserSeeder.Run should have comment or be unexported (golint)
    • Line 70: warning: exported method UserSeeder.SeederName should have comment or be unexported (golint)
    • Line 74: warning: don't use underscores in Go names; func seeder_2021_04_14T06_10_33Z_General_UserSeeder should be seeder2021_04_14T06_10_33ZGeneralUserSeeder (golint)
    • go-web-app/common/util/fileutils/common.go
    • Line 25: warning: exported const MEDIA_FILE_TYPE_IMAGE should have comment (or a comment on this block) or be unexported (golint)
    • Line 58: warning: exported type Base2Bytes should have comment or be unexported (golint)
    • Line 60: warning: exported function GetMimeByPath should have comment or be unexported (golint)
    • Line 70: warning: exported function GetMimeByOsFile should have comment or be unexported (golint)
    • Line 88: warning: exported function GetMimeByMultipartFile should have comment or be unexported (golint)
    • Line 106: warning: exported function CopyToTempFileByMultipartFile should have comment or be unexported (golint)
    • Line 132: warning: exported function GenTempFilePath should have comment or be unexported (golint)
    • Line 136: warning: exported function GenTempFileName should have comment or be unexported (golint)
    • Line 140: warning: exported function GenRandName should have comment or be unexported (golint)
    • Line 147: warning: exported function GenRandNameWithExtension should have comment or be unexported (golint)
    • Line 151: warning: exported function GetExtension should have comment or be unexported (golint)
    • Line 164: warning: comment on exported function GenMd5FromFile should be of the form "GenMd5FromFile ..." (golint)
    • go-web-app/app/main.go
    • Line 44: warning: exported var ServiceName should have comment or be unexported (golint)
    • Line 50: warning: exported type Config should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.

    • go-web-app/app/main.go
    • Line 29: warning: package go-web-app/app/docs is not in GOROOT (/usr/local/go/src/go-web-app/app/docs) (ineffassign)
    • Line 29: warning: could not import go-web-app/app/docs (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!