Preparing report...

Report for github.com/casdoor/casdoor

(v1.611.1)

A+    Excellent!    Found 40 issues across 279 files

Tweet

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!


gofmt100%

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

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo85%

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.

    • object/user.go
    • Line 769: warning: cyclomatic complexity 23 of function AddUser() is high (> 15) (gocyclo)
    • Line 644: warning: cyclomatic complexity 16 of function UpdateUser() is high (> 15) (gocyclo)
    • idp/goth.go
    • Line 93: warning: cyclomatic complexity 62 of function NewGothIdProvider() is high (> 15) (gocyclo)
    • idp/provider.go
    • Line 60: warning: cyclomatic complexity 31 of function GetIdProvider() is high (> 15) (gocyclo)
    • controllers/casbin_api.go
    • Line 36: warning: cyclomatic complexity 19 of function (*ApiController).Enforce() is high (> 15) (gocyclo)
    • Line 166: warning: cyclomatic complexity 16 of function (*ApiController).BatchEnforce() is high (> 15) (gocyclo)
    • object/ormer.go
    • Line 287: warning: cyclomatic complexity 29 of function (*Ormer).createTable() is high (> 15) (gocyclo)
    • controllers/user.go
    • Line 145: warning: cyclomatic complexity 23 of function (*ApiController).GetUser() is high (> 15) (gocyclo)
    • Line 250: warning: cyclomatic complexity 18 of function (*ApiController).UpdateUser() is high (> 15) (gocyclo)
    • Line 436: warning: cyclomatic complexity 16 of function (*ApiController).SetPassword() is high (> 15) (gocyclo)
    • controllers/auth.go
    • Line 311: warning: cyclomatic complexity 118 of function (*ApiController).Login() is high (> 15) (gocyclo)
    • Line 55: warning: cyclomatic complexity 40 of function (*ApiController).HandleLoggedIn() is high (> 15) (gocyclo)
    • controllers/verification.go
    • Line 128: warning: cyclomatic complexity 55 of function (*ApiController).SendVerificationCode() is high (> 15) (gocyclo)
    • Line 371: warning: cyclomatic complexity 19 of function (*ApiController).ResetEmailOrPhone() is high (> 15) (gocyclo)
    • Line 471: warning: cyclomatic complexity 16 of function (*ApiController).VerifyCode() is high (> 15) (gocyclo)
    • object/ldap_conn.go
    • Line 142: warning: cyclomatic complexity 24 of function (*LdapConn).GetLdapUsers() is high (> 15) (gocyclo)
    • Line 269: warning: cyclomatic complexity 17 of function SyncLdapUsers() is high (> 15) (gocyclo)
    • controllers/account.go
    • Line 80: warning: cyclomatic complexity 43 of function (*ApiController).Signup() is high (> 15) (gocyclo)
    • Line 298: warning: cyclomatic complexity 18 of function (*ApiController).Logout() is high (> 15) (gocyclo)
    • ldap/util.go
    • Line 154: warning: cyclomatic complexity 23 of function buildUserFilterCondition() is high (> 15) (gocyclo)
    • Line 240: warning: cyclomatic complexity 17 of function GetFilteredUsers() is high (> 15) (gocyclo)
    • object/role.go
    • Line 90: warning: cyclomatic complexity 23 of function UpdateRole() is high (> 15) (gocyclo)
    • object/adapter.go
    • Line 142: warning: cyclomatic complexity 18 of function (*Adapter).InitAdapter() is high (> 15) (gocyclo)
    • object/user_util.go
    • Line 258: warning: cyclomatic complexity 43 of function CheckPermissionForUpdateUser() is high (> 15) (gocyclo)
    • Line 175: warning: cyclomatic complexity 18 of function SetUserOAuthProperties() is high (> 15) (gocyclo)
    • object/check.go
    • Line 36: warning: cyclomatic complexity 40 of function CheckUserSignup() is high (> 15) (gocyclo)
    • Line 440: warning: cyclomatic complexity 20 of function CheckLoginPermission() is high (> 15) (gocyclo)
    • Line 329: warning: cyclomatic complexity 16 of function CheckUserPassword() is high (> 15) (gocyclo)
    • authz/authz.go
    • Line 155: warning: cyclomatic complexity 23 of function isAllowedInDemoMode() is high (> 15) (gocyclo)
    • controllers/mfa.go
    • Line 158: warning: cyclomatic complexity 16 of function (*ApiController).MfaSetupEnable() is high (> 15) (gocyclo)
    • object/init_data.go
    • Line 141: warning: cyclomatic complexity 32 of function readInitDataFromFile() is high (> 15) (gocyclo)
    • Line 51: warning: cyclomatic complexity 29 of function InitFromFile() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words