Preparing report...

Report for github.com/jkuup/go-xops

A+    Excellent!    Found 49 issues across 79 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!


gocyclo98%

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.


golint40%

Golint is a linter for Go source code.

    • go-xops/internal/service/system/sys_api.go
    • Line 16: warning: comment on exported type ApiListReq should be of the form "ApiListReq ..." (with optional leading article) (golint)
    • Line 27: warning: comment on exported type CreateApiReq should be of the form "CreateApiReq ..." (with optional leading article) (golint)
    • Line 49: warning: exported type ApiTreeResp should have comment or be unexported (golint)
    • Line 54: warning: exported function GetApis should have comment or be unexported (golint)
    • Line 91: warning: comment on exported function CreateApi should be of the form "CreateApi ..." (golint)
    • Line 100: warning: comment on exported function UpdateApiById should be of the form "UpdateApiById ..." (golint)
    • Line 116: warning: comment on exported function DeleteApiByIds should be of the form "DeleteApiByIds ..." (golint)
    • go-xops/api/v1/cmdb/sftp.go
    • Line 12: warning: don't use underscores in Go names; type sftp_resp should be sftpResp (golint)
    • Line 19: warning: exported function Sftp_ssh should have comment or be unexported (golint)
    • Line 19: warning: don't use underscores in Go names; func Sftp_ssh should be SftpSSH (golint)
    • Line 42: warning: don't use underscores in Go names; var resp_msg should be respMsg (golint)
    • go-xops/api/v1/cmdb/ws_ssh.go
    • Line 22: warning: exported type SerInfo should have comment or be unexported (golint)
    • Line 31: warning: exported type WsAuth should have comment or be unexported (golint)
    • Line 68: warning: exported function WsSsh should have comment or be unexported (golint)
    • go-xops/pkg/common/custom.go
    • Line 57: warning: comment on exported type IdsReq should be of the form "IdsReq ..." (with optional leading article) (golint)
    • Line 62: warning: comment on exported type KeyReq should be of the form "KeyReq ..." (with optional leading article) (golint)
    • go-xops/internal/service/system/sys_operlog.go
    • Line 12: warning: comment on exported type OperLogListReq should be of the form "OperLogListReq ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported method OperLogListReq.FieldTrans should be of the form "FieldTrans ..." (golint)
    • Line 29: warning: comment on exported type CreateOperLogRequestStruct should be of the form "CreateOperLogRequestStruct ..." (with optional leading article) (golint)
    • Line 44: warning: exported type OperationLogListResp should have comment or be unexported (golint)
    • Line 61: warning: comment on exported function GetOperLogs should be of the form "GetOperLogs ..." (golint)
    • Line 102: warning: comment on exported function DeleteOperationLogByIds should be of the form "DeleteOperationLogByIds ..." (golint)
    • go-xops/internal/service/system/sys_role.go
    • Line 16: warning: comment on exported type RoleListReq should be of the form "RoleListReq ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported type UpdateRolePermsReq should be of the form "UpdateRolePermsReq ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported type CreateRoleReq should be of the form "CreateRoleReq ..." (with optional leading article) (golint)
    • Line 39: warning: comment on exported type RolePermsResp should be of the form "RolePermsResp ..." (with optional leading article) (golint)
    • Line 48: warning: comment on exported type RoleListResp should be of the form "RoleListResp ..." (with optional leading article) (golint)
    • Line 59: warning: comment on exported function GetRoles should be of the form "GetRoles ..." (golint)
    • Line 98: warning: comment on exported function GetPermsByRoleId should be of the form "GetPermsByRoleId ..." (golint)
    • Line 134: warning: comment on exported function CreateRole should be of the form "CreateRole ..." (golint)
    • Line 143: warning: comment on exported function UpdateRoleById should be of the form "UpdateRoleById ..." (golint)
    • Line 158: warning: comment on exported function UpdateRoleMenusById should be of the form "UpdateRoleMenusById ..." (golint)
    • Line 172: warning: comment on exported function UpdateRoleApisById should be of the form "UpdateRoleApisById ..." (golint)
    • Line 207: warning: comment on exported function DeleteRoleByIds should be of the form "DeleteRoleByIds ..." (golint)
    • Line 219: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • go-xops/api/v1/cmdb/cmd.go
    • Line 41: warning: exported function CmdExec should have comment or be unexported (golint)
    • Line 105: warning: exported function Sftp should have comment or be unexported (golint)
    • Line 140: warning: exported function SftpDow should have comment or be unexported (golint)
    • go-xops/internal/service/terminal/ssh_connection.go
    • Line 44: warning: comment on exported type SshConn should be of the form "SshConn ..." (with optional leading article) (golint)
    • Line 66: warning: comment on exported function NewSshConn should be of the form "NewSshConn ..." (golint)
    • Line 108: warning: exported method SshConn.Close should have comment or be unexported (golint)
    • Line 116: warning: receiver name ssConn should be consistent with previous receiver name s for SshConn (golint)
    • Line 166: warning: exported method SshConn.SendComboOutput should have comment or be unexported (golint)
    • Line 166: warning: receiver name ssConn should be consistent with previous receiver name s for SshConn (golint)
    • Line 188: warning: exported method SshConn.SessionWait should have comment or be unexported (golint)
    • Line 188: warning: receiver name ssConn should be consistent with previous receiver name s for SshConn (golint)
    • go-xops/middleware/jwt.go
    • Line 17: warning: exported type RegisterAndLoginReq should have comment or be unexported (golint)
    • Line 22: warning: exported function InitAuth should have comment or be unexported (golint)
    • go-xops/assets/system/sys_menu.go
    • Line 5: warning: comment on exported type SysMenu should be of the form "SysMenu ..." (with optional leading article) (golint)
    • Line 19: warning: exported method SysMenu.TableName should have comment or be unexported (golint)
    • Line 23: warning: comment on exported function GetCheckedMenuIds should be of the form "GetCheckedMenuIds ..." (golint)
    • Line 50: warning: comment on exported method SysMenu.GetChildrenIds should be of the form "GetChildrenIds ..." (golint)
    • go-xops/pkg/common/config.go
    • Line 3: warning: comment on exported type Configuration should be of the form "Configuration ..." (with optional leading article) (golint)
    • Line 15: warning: exported type SystemConfiguration should have comment or be unexported (golint)
    • Line 23: warning: exported type MysqlConfiguration should have comment or be unexported (golint)
    • Line 36: warning: exported type CasbinConfiguration should have comment or be unexported (golint)
    • Line 41: warning: exported type JwtConfiguration should have comment or be unexported (golint)
    • Line 48: warning: exported type UploadConfiguration should have comment or be unexported (golint)
    • Line 53: warning: exported type PrometheusAddress should have comment or be unexported (golint)
    • Line 57: warning: exported type KubeConfiguration should have comment or be unexported (golint)
    • go-xops/pkg/common/global.go
    • Line 40: warning: comment on exported function NewValidatorError should be of the form "NewValidatorError ..." (golint)
    • Line 51: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • go-xops/internal/service/system/sys_casbin.go
    • Line 8: warning: comment on exported function GetRoleCasbins should be of the form "GetRoleCasbins ..." (golint)
    • Line 23: warning: comment on exported function CreateRoleCasbin should be of the form "CreateRoleCasbin ..." (golint)
    • Line 29: warning: comment on exported function BatchCreateRoleCasbins should be of the form "BatchCreateRoleCasbins ..." (golint)
    • Line 44: warning: comment on exported function DeleteRoleCasbin should be of the form "DeleteRoleCasbin ..." (golint)
    • Line 50: warning: comment on exported function BatchDeleteRoleCasbins should be of the form "BatchDeleteRoleCasbins ..." (golint)
    • Line 65: warning: comment on exported function GetCasbinListByRoleId should be of the form "GetCasbinListByRoleId ..." (golint)
    • go-xops/internal/service/cmd/host.go
    • Line 15: warning: exported type HostListReq should have comment or be unexported (golint)
    • Line 58: warning: don't use underscores in Go names; var host_name should be hostName (golint)
    • Line 68: warning: don't use underscores in Go names; var host_type should be hostType (golint)
    • Line 73: warning: don't use underscores in Go names; var auth_type should be authType (golint)
    • Line 89: warning: comment on exported function CreateHost should be of the form "CreateHost ..." (golint)
    • Line 98: warning: comment on exported function UpdateHostById should be of the form "UpdateHostById ..." (golint)
    • Line 114: warning: comment on exported function DeleteHostsById should be of the form "DeleteHostsById ..." (golint)
    • Line 121: warning: comment on exported function GetHostByid should be of the form "GetHostByid ..." (golint)
    • go-xops/internal/service/terminal/sftp/sftp.go
    • Line 20: warning: don't use underscores in Go names; type sftp_req should be sftpReq (golint)
    • Line 27: warning: don't use underscores in Go names; type sftp_resp should be sftpResp (golint)
    • Line 34: warning: exported type MyClient should have comment or be unexported (golint)
    • Line 43: warning: exported var Client should have comment or be unexported (golint)
    • Line 49: warning: exported method MyClient.ReceiveWsMsg should have comment or be unexported (golint)
    • Line 90: warning: don't use underscores in Go names; var io_data should be ioData (golint)
    • Line 160: warning: exported method MyClient.SessionWait should have comment or be unexported (golint)
    • go-xops/internal/service/system/sys_dept.go
    • Line 15: warning: comment on exported type CreateDeptReq should be of the form "CreateDeptReq ..." (with optional leading article) (golint)
    • Line 23: warning: comment on exported type UpdateDeptReq should be of the form "UpdateDeptReq ..." (with optional leading article) (golint)
    • Line 31: warning: exported type DeptListReq should have comment or be unexported (golint)
    • Line 37: warning: comment on exported type DeptTreeResp should be of the form "DeptTreeResp ..." (with optional leading article) (golint)
    • Line 48: warning: exported type DeptTreeResppList should have comment or be unexported (golint)
    • Line 61: warning: comment on exported function GetDepts should be of the form "GetDepts ..." (golint)
    • Line 85: warning: comment on exported function GenDeptTree should be of the form "GenDeptTree ..." (golint)
    • Line 109: warning: comment on exported function CreateDept should be of the form "CreateDept ..." (golint)
    • Line 118: warning: comment on exported function UpdateDeptById should be of the form "UpdateDeptById ..." (golint)
    • Line 136: warning: comment on exported function DeleteDeptByIds should be of the form "DeleteDeptByIds ..." (golint)
    • go-xops/internal/service/cmd/cmd.go
    • Line 20: warning: exported type SSH should have comment or be unexported (golint)
    • Line 29: warning: comment on exported type ClientConfig should be of the form "ClientConfig ..." (with optional leading article) (golint)
    • Line 39: warning: exported type Counter should have comment or be unexported (golint)
    • Line 52: warning: exported method Counter.Incre should have comment or be unexported (golint)
    • Line 59: warning: exported method Counter.Decre should have comment or be unexported (golint)
    • Line 65: warning: exported function NewSSH should have comment or be unexported (golint)
    • Line 76: warning: exported method SSH.Connect should have comment or be unexported (golint)
    • Line 111: warning: exported method SSH.Run should have comment or be unexported (golint)
    • Line 126: warning: exported method SSH.Ping should have comment or be unexported (golint)
    • Line 135: warning: exported method SSH.CmdExec should have comment or be unexported (golint)
    • Line 165: warning: exported function DecryptKey should have comment or be unexported (golint)
    • Line 168: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 181: warning: exported method ClientConfig.CreateClient should have comment or be unexported (golint)
    • Line 215: warning: exported method ClientConfig.RunShell should have comment or be unexported (golint)
    • Line 232: warning: exported method ClientConfig.Upload should have comment or be unexported (golint)
    • Line 253: warning: exported method ClientConfig.Download should have comment or be unexported (golint)
    • go-xops/internal/service/system/sys_user.go
    • Line 16: warning: exported type LoginResp should have comment or be unexported (golint)
    • Line 25: warning: exported type CreateUserReq should have comment or be unexported (golint)
    • Line 37: warning: exported type UpdateUserBaseInfoReq should have comment or be unexported (golint)
    • Line 43: warning: exported type UpdateUserReq should have comment or be unexported (golint)
    • Line 53: warning: exported type UserListReq should have comment or be unexported (golint)
    • Line 63: warning: exported type ChangePwdReq should have comment or be unexported (golint)
    • Line 68: warning: comment on exported type UserRoleResp should be of the form "UserRoleResp ..." (with optional leading article) (golint)
    • Line 77: warning: exported type UserDeptResp should have comment or be unexported (golint)
    • Line 83: warning: comment on exported type UserInfoResp should be of the form "UserInfoResp ..." (with optional leading article) (golint)
    • Line 95: warning: comment on exported type UserListResp should be of the form "UserListResp ..." (with optional leading article) (golint)
    • Line 113: warning: exported function LoginCheck should have comment or be unexported (golint)
    • Line 131: warning: exported function GetUserById should have comment or be unexported (golint)
    • Line 138: warning: comment on exported function CheckUser should be of the form "CheckUser ..." (golint)
    • Line 149: warning: comment on exported function CreateUser should be of the form "CreateUser ..." (golint)
    • Line 199: warning: comment on exported function GetUsers should be of the form "GetUsers ..." (golint)
    • Line 240: warning: comment on exported function DeleteUserByIds should be of the form "DeleteUserByIds ..." (golint)
    • go-xops/internal/service/k8s/deployment.go
    • Line 15: warning: exported type ApplicationReq should have comment or be unexported (golint)
    • Line 22: warning: exported type DeploymentReq should have comment or be unexported (golint)
    • Line 33: warning: exported type UpDeploymentReq should have comment or be unexported (golint)
    • Line 41: warning: exported function GetDeployments should have comment or be unexported (golint)
    • Line 61: warning: exported function GetDeployment should have comment or be unexported (golint)
    • Line 72: warning: exported function UpdateDeployment should have comment or be unexported (golint)
    • Line 88: warning: exported function GetDeploymentStatus should have comment or be unexported (golint)
    • go-xops/assets/model.go
    • Line 12: warning: comment on exported type Model should be of the form "Model ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported method Model.TableName should be of the form "TableName ..." (golint)
    • Line 27: warning: comment on exported type LocalTime should be of the form "LocalTime ..." (with optional leading article) (golint)
    • Line 32: warning: exported method LocalTime.UnmarshalJSON should have comment or be unexported (golint)
    • Line 45: warning: exported method LocalTime.MarshalJSON should have comment or be unexported (golint)
    • Line 50: warning: comment on exported method LocalTime.Value should be of the form "Value ..." (golint)
    • Line 59: warning: comment on exported method LocalTime.Scan should be of the form "Scan ..." (golint)
    • Line 74: warning: comment on exported method LocalTime.DateString should be of the form "DateString ..." (golint)
    • go-xops/internal/service/system/sys_dict.go
    • Line 14: warning: comment on exported type CreateDictReq should be of the form "CreateDictReq ..." (with optional leading article) (golint)
    • Line 23: warning: comment on exported type UpdateDictReq should be of the form "UpdateDictReq ..." (with optional leading article) (golint)
    • Line 32: warning: exported type DictListReq should have comment or be unexported (golint)
    • Line 41: warning: exported type DictTreeResp should have comment or be unexported (golint)
    • Line 52: warning: comment on exported function GetDicts should be of the form "GetDicts ..." (golint)
    • Line 86: warning: comment on exported function GenDictTree should be of the form "GenDictTree ..." (golint)
    • Line 108: warning: comment on exported function CreateDict should be of the form "CreateDict ..." (golint)
    • Line 117: warning: comment on exported function UpdateDictById should be of the form "UpdateDictById ..." (golint)
    • Line 135: warning: comment on exported function DeleteDictByIds should be of the form "DeleteDictByIds ..." (golint)
    • go-xops/internal/service/system/sys_menu.go
    • Line 13: warning: exported type MenuListReq should have comment or be unexported (golint)
    • Line 21: warning: comment on exported type CreateMenuReq should be of the form "CreateMenuReq ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported type UpdateMenuReq should be of the form "UpdateMenuReq ..." (with optional leading article) (golint)
    • Line 41: warning: comment on exported type MenuTreeResp should be of the form "MenuTreeResp ..." (with optional leading article) (golint)
    • Line 53: warning: exported type MenuTreeRespList should have comment or be unexported (golint)
    • Line 66: warning: comment on exported function GetUserMenuList should be of the form "GetUserMenuList ..." (golint)
    • Line 84: warning: comment on exported function GetMenus should be of the form "GetMenus ..." (golint)
    • Line 93: warning: comment on exported function GenMenuTree should be of the form "GenMenuTree ..." (golint)
    • Line 118: warning: comment on exported function CreateMenu should be of the form "CreateMenu ..." (golint)
    • Line 127: warning: comment on exported function UpdateMenuById should be of the form "UpdateMenuById ..." (golint)
    • Line 145: warning: comment on exported function DeleteMenuByIds should be of the form "DeleteMenuByIds ..." (golint)
    • go-xops/pkg/utils/json.go
    • Line 26: warning: comment on exported function JsonI2Struct should be of the form "JsonI2Struct ..." (golint)
    • Line 33: warning: comment on exported function Struct2StructByJson should be of the form "Struct2StructByJson ..." (golint)
    • go-xops/api/v1/cmdb/host.go
    • Line 15: warning: comment on exported function GetHosts should be of the form "GetHosts ..." (golint)
    • Line 41: warning: comment on exported function CreateHost should be of the form "CreateHost ..." (golint)
    • Line 69: warning: comment on exported function GetHostInfo should be of the form "GetHostInfo ..." (golint)
    • Line 94: warning: comment on exported function UpdateHostById should be of the form "UpdateHostById ..." (golint)
    • Line 116: warning: comment on exported function BatchDeleteHostByIds should be of the form "BatchDeleteHostByIds ..." (golint)
    • go-xops/assets/system/sys_api.go
    • Line 5: warning: comment on exported type SysApi should be of the form "SysApi ..." (with optional leading article) (golint)
    • Line 16: warning: exported method SysApi.TableName should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words