Avoid deeply nested control flow statements.
if authRecord.SubResource == common.AliasTemplateRelease &&
len(requestInfo.Parts) == 5 && requestInfo.Parts[4] == pathReleaseSchema {
handleGetSchema(c, mgr, r, authRecord, requestInfo)
return
}
Function handleGetSchema
has 5 arguments (exceeds 4 allowed). Consider refactoring.
func handleGetSchema(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
Function handleCluster
has 5 arguments (exceeds 4 allowed). Consider refactoring.
func handleCluster(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
Function handleApplication
has 5 arguments (exceeds 4 allowed). Consider refactoring.
func handleApplication(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
Function handleTemplate
has 5 arguments (exceeds 4 allowed). Consider refactoring.
func handleTemplate(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
Function handleGetSchema
has 5 return statements (exceeds 4 allowed).
func handleGetSchema(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
template, err := mgr.TemplateMgr.GetByName(c, authRecord.Name)
if err != nil {
if e, ok := perror.Cause(err).(*herrors.HorizonErrNotFound); ok && e.Source == herrors.TemplateInDB {
Similar blocks of code found in 3 locations. Consider refactoring.
func handleTemplate(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
template, err := mgr.TemplateMgr.GetByName(c, authRecord.Name)
if err != nil {
if e, ok := perror.Cause(err).(*herrors.HorizonErrNotFound); ok && e.Source == herrors.TemplateInDB {
Similar blocks of code found in 3 locations. Consider refactoring.
func handleCluster(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
cluster, err := mgr.ClusterMgr.GetByName(c, authRecord.Name)
if err != nil {
if e, ok := perror.Cause(err).(*herrors.HorizonErrNotFound); ok && e.Source == herrors.ClusterInDB {
Similar blocks of code found in 3 locations. Consider refactoring.
func handleApplication(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
app, err := mgr.ApplicationMgr.GetByName(c, authRecord.Name)
if err != nil {
if e, ok := perror.Cause(err).(*herrors.HorizonErrNotFound); ok && e.Source == herrors.ApplicationInDB {
There are no issues that match your filters.