horizoncd/horizon

View on GitHub
core/middleware/admission/admission.go

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 2 of 2 total issues

Function Middleware has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
Open

func Middleware(skippers ...middleware.Skipper) gin.HandlerFunc {
return middleware.New(func(c *gin.Context) {
// get auth record
record, ok := c.Get(common.ContextAuthRecord)
if !ok {
Severity: Minor
Found in core/middleware/admission/admission.go - About 2 hrs to fix

Function Middleware has 74 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Middleware(skippers ...middleware.Skipper) gin.HandlerFunc {
return middleware.New(func(c *gin.Context) {
// get auth record
record, ok := c.Get(common.ContextAuthRecord)
if !ok {
Severity: Minor
Found in core/middleware/admission/admission.go - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status