efritz/chevron

View on GitHub
middleware/schema.go

Summary

Maintainability
A
45 mins
Test Coverage

Method SchemaMiddleware.Convert has 7 return statements (exceeds 4 allowed).
Open

func (m *SchemaMiddleware) Convert(f chevron.Handler) (chevron.Handler, error) {
    schema, err := loadSchema(m.path)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in middleware/schema.go - About 45 mins to fix

    exported type SchemaMiddleware should have comment or be unexported
    Open

        SchemaMiddleware struct {
    Severity: Minor
    Found in middleware/schema.go by golint

    exported type SchemaBadRequestFactory should have comment or be unexported
    Open

        SchemaBadRequestFactory          func() response.Response
    Severity: Minor
    Found in middleware/schema.go by golint

    exported function GetJSONData should have comment or be unexported
    Open

    func GetJSONData(ctx context.Context) []byte {
    Severity: Minor
    Found in middleware/schema.go by golint

    exported var TokenJSONData should have comment or be unexported
    Open

    var TokenJSONData = tokenJSONData("chevron.middleware.json_data")
    Severity: Minor
    Found in middleware/schema.go by golint

    exported function NewSchemaMiddleware should have comment or be unexported
    Open

    func NewSchemaMiddleware(path string, configs ...SchemaConfigFunc) chevron.Middleware {
    Severity: Minor
    Found in middleware/schema.go by golint

    exported type SchemaUnprocessableEntityFactory should have comment or be unexported
    Open

        SchemaUnprocessableEntityFactory func([]gojsonschema.ResultError) response.Response
    Severity: Minor
    Found in middleware/schema.go by golint

    exported method SchemaMiddleware.Convert should have comment or be unexported
    Open

    func (m *SchemaMiddleware) Convert(f chevron.Handler) (chevron.Handler, error) {
    Severity: Minor
    Found in middleware/schema.go by golint

    There are no issues that match your filters.

    Category
    Status