Preparing report...

Report for github.com/go-courier/oas

A+    Excellent!    Found 15 issues across 30 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!


gocyclo96%

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.

    • oas/utils.go
    • Line 17: warning: cyclomatic complexity 20 of function concatJSON() is high (> 15) (gocyclo)

golint53%

Golint is a linter for Go source code.

    • oas/external_docs.go
    • Line 3: warning: exported function NewExternalDoc should have comment or be unexported (golint)
    • Line 10: warning: exported type ExternalDoc should have comment or be unexported (golint)
    • oas/info.go
    • Line 3: warning: exported type Info should have comment or be unexported (golint)
    • Line 8: warning: exported method Info.MarshalJSON should have comment or be unexported (golint)
    • Line 12: warning: exported method Info.UnmarshalJSON should have comment or be unexported (golint)
    • Line 16: warning: exported type InfoObject should have comment or be unexported (golint)
    • Line 25: warning: exported type Contact should have comment or be unexported (golint)
    • Line 30: warning: exported method Contact.MarshalJSON should have comment or be unexported (golint)
    • Line 34: warning: exported method Contact.UnmarshalJSON should have comment or be unexported (golint)
    • Line 38: warning: exported type ContactObject should have comment or be unexported (golint)
    • Line 44: warning: exported type License should have comment or be unexported (golint)
    • Line 49: warning: exported method License.MarshalJSON should have comment or be unexported (golint)
    • Line 53: warning: exported method License.UnmarshalJSON should have comment or be unexported (golint)
    • Line 57: warning: exported type LicenseObject should have comment or be unexported (golint)
    • oas/responses.go
    • Line 9: warning: exported type Responses should have comment or be unexported (golint)
    • Line 14: warning: exported method Responses.MarshalJSON should have comment or be unexported (golint)
    • Line 18: warning: exported method Responses.UnmarshalJSON should have comment or be unexported (golint)
    • Line 22: warning: exported type ResponsesObject should have comment or be unexported (golint)
    • Line 27: warning: exported method ResponsesObject.SetDefaultResponse should have comment or be unexported (golint)
    • Line 34: warning: exported method ResponsesObject.AddResponse should have comment or be unexported (golint)
    • Line 44: warning: exported method ResponsesObject.MarshalJSON should have comment or be unexported (golint)
    • Line 55: warning: exported method ResponsesObject.UnmarshalJSON should have comment or be unexported (golint)
    • Line 74: warning: exported function NewResponse should have comment or be unexported (golint)
    • Line 80: warning: exported type Response should have comment or be unexported (golint)
    • Line 86: warning: exported method Response.MarshalJSON should have comment or be unexported (golint)
    • Line 90: warning: exported method Response.UnmarshalJSON should have comment or be unexported (golint)
    • Line 94: warning: exported type ResponseObject should have comment or be unexported (golint)
    • Line 101: warning: exported type WithLinks should have comment or be unexported (golint)
    • Line 105: warning: exported method WithLinks.AddLink should have comment or be unexported (golint)
    • Line 115: warning: exported function NewLink should have comment or be unexported (golint)
    • Line 123: warning: exported type Link should have comment or be unexported (golint)
    • Line 129: warning: exported method Link.MarshalJSON should have comment or be unexported (golint)
    • Line 133: warning: exported method Link.UnmarshalJSON should have comment or be unexported (golint)
    • Line 137: warning: exported type LinkObject should have comment or be unexported (golint)
    • Line 146: warning: exported method LinkObject.AddParameter should have comment or be unexported (golint)
    • Line 153: warning: exported method LinkObject.SetRequestBody should have comment or be unexported (golint)
    • Line 157: warning: exported type RuntimeExpression should have comment or be unexported (golint)
    • oas/security_scheme.go
    • Line 3: warning: exported type WithSecuritySchemes should have comment or be unexported (golint)
    • Line 7: warning: exported method WithSecuritySchemes.AddSecurityScheme should have comment or be unexported (golint)
    • Line 17: warning: exported type WithSecurityRequirement should have comment or be unexported (golint)
    • Line 21: warning: exported method WithSecurityRequirement.AddSecurityRequirement should have comment or be unexported (golint)
    • Line 28: warning: exported type SecurityRequirement should have comment or be unexported (golint)
    • Line 30: warning: exported function NewAPIKeySecurityScheme should have comment or be unexported (golint)
    • Line 40: warning: exported function NewHTTPSecurityScheme should have comment or be unexported (golint)
    • Line 53: warning: exported function NewOAuth2SecurityScheme should have comment or be unexported (golint)
    • Line 64: warning: exported function NewOpenIdConnectSecurityScheme should have comment or be unexported (golint)
    • Line 73: warning: exported type SecurityScheme should have comment or be unexported (golint)
    • Line 78: warning: exported method SecurityScheme.MarshalJSON should have comment or be unexported (golint)
    • Line 82: warning: exported method SecurityScheme.UnmarshalJSON should have comment or be unexported (golint)
    • Line 86: warning: exported type SecuritySchemeObject should have comment or be unexported (golint)
    • Line 97: warning: exported type SecurityType should have comment or be unexported (golint)
    • Line 100: warning: exported const SecurityTypeAPIKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 106: warning: exported type OAuthFlows should have comment or be unexported (golint)
    • Line 111: warning: exported method OAuthFlows.MarshalJSON should have comment or be unexported (golint)
    • Line 115: warning: exported method OAuthFlows.UnmarshalJSON should have comment or be unexported (golint)
    • Line 119: warning: exported type OAuthFlowsObject should have comment or be unexported (golint)
    • Line 126: warning: exported function NewOAuthFlow should have comment or be unexported (golint)
    • Line 137: warning: exported type OAuthFlow should have comment or be unexported (golint)
    • Line 142: warning: exported method OAuthFlow.MarshalJSON should have comment or be unexported (golint)
    • Line 146: warning: exported method OAuthFlow.UnmarshalJSON should have comment or be unexported (golint)
    • Line 150: warning: exported type OAuthFlowObject should have comment or be unexported (golint)
    • oas/openapi.go
    • Line 3: warning: exported function NewOpenAPI should have comment or be unexported (golint)
    • Line 10: warning: exported type OpenAPI should have comment or be unexported (golint)
    • Line 15: warning: exported method OpenAPI.MarshalJSON should have comment or be unexported (golint)
    • Line 19: warning: exported method OpenAPI.UnmarshalJSON should have comment or be unexported (golint)
    • Line 23: warning: exported type OpenAPIObject should have comment or be unexported (golint)
    • oas/spec_extensions.go
    • Line 8: warning: exported type SpecExtensions should have comment or be unexported (golint)
    • Line 12: warning: exported method SpecExtensions.AddExtension should have comment or be unexported (golint)
    • Line 22: warning: exported method SpecExtensions.MarshalJSON should have comment or be unexported (golint)
    • Line 32: warning: exported method SpecExtensions.UnmarshalJSON should have comment or be unexported (golint)
    • oas/tag.go
    • Line 3: warning: exported type WithTags should have comment or be unexported (golint)
    • Line 7: warning: exported method WithTags.AddTag should have comment or be unexported (golint)
    • Line 14: warning: exported function NewTag should have comment or be unexported (golint)
    • Line 22: warning: exported type Tag should have comment or be unexported (golint)
    • Line 27: warning: exported method Tag.MarshalJSON should have comment or be unexported (golint)
    • Line 31: warning: exported method Tag.UnmarshalJSON should have comment or be unexported (golint)
    • Line 35: warning: exported type TagObject should have comment or be unexported (golint)
    • oas/components.go
    • Line 9: warning: exported type Components should have comment or be unexported (golint)
    • Line 14: warning: exported method Components.MarshalJSON should have comment or be unexported (golint)
    • Line 18: warning: exported method Components.UnmarshalJSON should have comment or be unexported (golint)
    • Line 22: warning: exported type ComponentsObject should have comment or be unexported (golint)
    • Line 34: warning: exported method ComponentsObject.AddSchema should have comment or be unexported (golint)
    • Line 44: warning: exported method ComponentsObject.AddResponse should have comment or be unexported (golint)
    • Line 54: warning: exported method ComponentsObject.AddParameter should have comment or be unexported (golint)
    • Line 64: warning: exported method ComponentsObject.AddRequestBody should have comment or be unexported (golint)
    • Line 74: warning: exported method ComponentsObject.RefSchema should have comment or be unexported (golint)
    • Line 81: warning: exported method ComponentsObject.RefResponse should have comment or be unexported (golint)
    • Line 90: warning: exported method ComponentsObject.RefParameter should have comment or be unexported (golint)
    • Line 99: warning: exported method ComponentsObject.RefExample should have comment or be unexported (golint)
    • Line 108: warning: exported method ComponentsObject.RefRequestBody should have comment or be unexported (golint)
    • Line 117: warning: exported method ComponentsObject.RefHeader should have comment or be unexported (golint)
    • Line 126: warning: exported method ComponentsObject.RefLink should have comment or be unexported (golint)
    • Line 135: warning: exported method ComponentsObject.RefCallback should have comment or be unexported (golint)
    • Line 144: warning: exported method ComponentsObject.RequireSecurity should have comment or be unexported (golint)
    • Line 159: warning: exported type Reference should have comment or be unexported (golint)
    • Line 163: warning: exported type Refer should have comment or be unexported (golint)
    • Line 167: warning: exported function NewComponentRefer should have comment or be unexported (golint)
    • Line 174: warning: exported function ParseComponentRefer should have comment or be unexported (golint)
    • Line 187: warning: exported type ComponentRefer should have comment or be unexported (golint)
    • Line 192: warning: exported method ComponentRefer.RefString should have comment or be unexported (golint)
    • Line 196: warning: exported type StringRefer should have comment or be unexported (golint)
    • Line 200: warning: exported method StringRefer.RefString should have comment or be unexported (golint)
    • Line 204: warning: exported method Reference.MarshalJSONRefFirst should have comment or be unexported (golint)
    • Line 213: warning: exported method Reference.UnmarshalJSONRefFirst should have comment or be unexported (golint)
    • oas/media_type.go
    • Line 3: warning: exported type WithContentOrSchema should have comment or be unexported (golint)
    • Line 8: warning: exported method WithContentOrSchema.SetSchema should have comment or be unexported (golint)
    • Line 13: warning: exported method WithContentOrSchema.AddContent should have comment or be unexported (golint)
    • Line 18: warning: exported type WithContent should have comment or be unexported (golint)
    • Line 22: warning: exported method WithContent.AddContent should have comment or be unexported (golint)
    • Line 32: warning: exported function NewMediaTypeWithSchema should have comment or be unexported (golint)
    • Line 38: warning: exported type MediaType should have comment or be unexported (golint)
    • Line 43: warning: exported method MediaType.MarshalJSON should have comment or be unexported (golint)
    • Line 47: warning: exported method MediaType.UnmarshalJSON should have comment or be unexported (golint)
    • Line 51: warning: exported type MediaTypeObject should have comment or be unexported (golint)
    • Line 58: warning: exported type WithEncoding should have comment or be unexported (golint)
    • Line 62: warning: exported method WithEncoding.AddEncoding should have comment or be unexported (golint)
    • Line 72: warning: exported function NewEncoding should have comment or be unexported (golint)
    • Line 76: warning: exported type Encoding should have comment or be unexported (golint)
    • Line 81: warning: exported method Encoding.MarshalJSON should have comment or be unexported (golint)
    • Line 85: warning: exported method Encoding.UnmarshalJSON should have comment or be unexported (golint)
    • Line 89: warning: exported type EncodingObject should have comment or be unexported (golint)
    • oas/parameter.go
    • Line 3: warning: exported function CookieParameter should have comment or be unexported (golint)
    • Line 12: warning: exported function HeaderParameter should have comment or be unexported (golint)
    • Line 21: warning: exported function PathParameter should have comment or be unexported (golint)
    • Line 30: warning: exported function QueryParameter should have comment or be unexported (golint)
    • Line 39: warning: exported type WithParameters should have comment or be unexported (golint)
    • Line 43: warning: exported method WithParameters.AddParameter should have comment or be unexported (golint)
    • Line 50: warning: exported type Parameter should have comment or be unexported (golint)
    • Line 56: warning: exported method Parameter.WithDesc should have comment or be unexported (golint)
    • Line 61: warning: exported method Parameter.MarshalJSON should have comment or be unexported (golint)
    • Line 65: warning: exported method Parameter.UnmarshalJSON should have comment or be unexported (golint)
    • Line 69: warning: exported type WithHeaders should have comment or be unexported (golint)
    • Line 73: warning: exported method WithHeaders.AddHeader should have comment or be unexported (golint)
    • Line 83: warning: exported function NewHeaderWithSchema should have comment or be unexported (golint)
    • Line 89: warning: exported type Header should have comment or be unexported (golint)
    • Line 95: warning: exported method Header.MarshalJSON should have comment or be unexported (golint)
    • Line 99: warning: exported method Header.UnmarshalJSON should have comment or be unexported (golint)
    • Line 103: warning: exported type ParameterObject should have comment or be unexported (golint)
    • Line 109: warning: exported type ParameterCommonObject should have comment or be unexported (golint)
    • Line 124: warning: exported type WithExamples should have comment or be unexported (golint)
    • Line 128: warning: exported method WithExamples.AddExample should have comment or be unexported (golint)
    • Line 138: warning: exported function NewExample should have comment or be unexported (golint)
    • Line 142: warning: exported type Example should have comment or be unexported (golint)
    • Line 148: warning: exported method Example.MarshalJSON should have comment or be unexported (golint)
    • Line 152: warning: exported method Example.UnmarshalJSON should have comment or be unexported (golint)
    • Line 156: warning: exported type ExampleObject should have comment or be unexported (golint)
    • Line 163: warning: exported function NewRequestBody should have comment or be unexported (golint)
    • Line 172: warning: exported type RequestBody should have comment or be unexported (golint)
    • Line 178: warning: exported method RequestBody.MarshalJSON should have comment or be unexported (golint)
    • Line 182: warning: exported method RequestBody.UnmarshalJSON should have comment or be unexported (golint)
    • Line 186: warning: exported type RequestBodyObject should have comment or be unexported (golint)
    • Line 192: warning: exported type Position should have comment or be unexported (golint)
    • Line 195: warning: exported const PositionQuery should have comment (or a comment on this block) or be unexported (golint)
    • Line 201: warning: exported type ParameterStyle should have comment or be unexported (golint)
    • Line 204: warning: comment on exported const ParameterStyleMatrix should be of the form "ParameterStyleMatrix ..." (golint)
    • Line 206: warning: comment on exported const ParameterStyleLabel should be of the form "ParameterStyleLabel ..." (golint)
    • Line 208: warning: comment on exported const ParameterStyleForm should be of the form "ParameterStyleForm ..." (golint)
    • Line 210: warning: comment on exported const ParameterStyleSimple should be of the form "ParameterStyleSimple ..." (golint)
    • Line 212: warning: comment on exported const ParameterStyleSpaceDelimited should be of the form "ParameterStyleSpaceDelimited ..." (golint)
    • Line 214: warning: comment on exported const ParameterStylePipeDelimited should be of the form "ParameterStylePipeDelimited ..." (golint)
    • Line 216: warning: comment on exported const ParameterStyleDeepObject should be of the form "ParameterStyleDeepObject ..." (golint)
    • oas/paths.go
    • Line 7: warning: exported type Paths should have comment or be unexported (golint)
    • Line 12: warning: exported method Paths.AddOperation should have comment or be unexported (golint)
    • Line 22: warning: exported method Paths.MarshalJSON should have comment or be unexported (golint)
    • Line 26: warning: exported method Paths.UnmarshalJSON should have comment or be unexported (golint)
    • Line 30: warning: exported type PathItem should have comment or be unexported (golint)
    • Line 36: warning: exported method PathItem.MarshalJSON should have comment or be unexported (golint)
    • Line 40: warning: exported method PathItem.UnmarshalJSON should have comment or be unexported (golint)
    • Line 44: warning: exported type HttpMethod should have comment or be unexported (golint)
    • Line 47: warning: exported const GET should have comment (or a comment on this block) or be unexported (golint)
    • Line 57: warning: exported type Operations should have comment or be unexported (golint)
    • Line 61: warning: exported method Operations.AddOperation should have comment or be unexported (golint)
    • Line 71: warning: exported method Operations.MarshalJSON should have comment or be unexported (golint)
    • Line 75: warning: exported method Operations.UnmarshalJSON should have comment or be unexported (golint)
    • Line 79: warning: exported type PathItemObject should have comment or be unexported (golint)
    • oas/schema.go
    • Line 7: warning: exported function NewSchema should have comment or be unexported (golint)
    • Line 16: warning: exported function RefSchemaByRefer should have comment or be unexported (golint)
    • Line 24: warning: exported function RefSchema should have comment or be unexported (golint)
    • Line 30: warning: exported function Integer should have comment or be unexported (golint)
    • Line 34: warning: exported function Long should have comment or be unexported (golint)
    • Line 38: warning: exported function Float should have comment or be unexported (golint)
    • Line 42: warning: exported function Double should have comment or be unexported (golint)
    • Line 46: warning: exported function String should have comment or be unexported (golint)
    • Line 50: warning: exported function Byte should have comment or be unexported (golint)
    • Line 54: warning: exported function Binary should have comment or be unexported (golint)
    • Line 58: warning: exported function Date should have comment or be unexported (golint)
    • Line 62: warning: exported function DateTime should have comment or be unexported (golint)
    • Line 66: warning: exported function Password should have comment or be unexported (golint)
    • Line 70: warning: exported function Boolean should have comment or be unexported (golint)
    • Line 74: warning: exported function ItemsOf should have comment or be unexported (golint)
    • Line 83: warning: exported type Props should have comment or be unexported (golint)
    • Line 85: warning: exported function ObjectOf should have comment or be unexported (golint)
    • Line 97: warning: exported function MapOf should have comment or be unexported (golint)
    • Line 101: warning: exported function KeyValueOf should have comment or be unexported (golint)
    • Line 114: warning: exported function AllOf should have comment or be unexported (golint)
    • Line 122: warning: exported function AnyOf should have comment or be unexported (golint)
    • Line 130: warning: exported function OneOf should have comment or be unexported (golint)
    • Line 138: warning: exported function Not should have comment or be unexported (golint)
    • Line 146: warning: exported type Schema should have comment or be unexported (golint)
    • Line 152: warning: exported method Schema.WithValidation should have comment or be unexported (golint)
    • Line 180: warning: exported method Schema.SetProperty should have comment or be unexported (golint)
    • Line 193: warning: exported method Schema.WithDesc should have comment or be unexported (golint)
    • Line 198: warning: exported method Schema.WithTitle should have comment or be unexported (golint)
    • Line 203: warning: exported method Schema.WithDiscriminator should have comment or be unexported (golint)
    • Line 208: warning: exported method Schema.MarshalJSON should have comment or be unexported (golint)
    • Line 212: warning: exported method Schema.UnmarshalJSON should have comment or be unexported (golint)
    • Line 216: warning: exported type SchemaValidation should have comment or be unexported (golint)
    • Line 243: warning: exported type SchemaObject should have comment or be unexported (golint)
    • Line 275: warning: exported type Discriminator should have comment or be unexported (golint)
    • Line 280: warning: exported type XML should have comment or be unexported (golint)
    • Line 288: warning: exported type Type should have comment or be unexported (golint)
    • Line 291: warning: exported const TypeInteger should have comment (or a comment on this block) or be unexported (golint)
    • Line 300: warning: exported type SchemaOrBool should have comment or be unexported (golint)
    • Line 305: warning: exported method SchemaOrBool.UnmarshalJSON should have comment or be unexported (golint)
    • Line 317: warning: exported method SchemaOrBool.MarshalJSON should have comment or be unexported (golint)
    • oas/operation.go
    • Line 3: warning: exported function NewOperation should have comment or be unexported (golint)
    • Line 9: warning: exported type Operation should have comment or be unexported (golint)
    • Line 14: warning: exported method Operation.WithTags should have comment or be unexported (golint)
    • Line 19: warning: exported method Operation.WithSummary should have comment or be unexported (golint)
    • Line 24: warning: exported method Operation.WithDesc should have comment or be unexported (golint)
    • Line 29: warning: exported method Operation.MarshalJSON should have comment or be unexported (golint)
    • Line 33: warning: exported method Operation.UnmarshalJSON should have comment or be unexported (golint)
    • Line 37: warning: exported type OperationObject should have comment or be unexported (golint)
    • Line 53: warning: exported method OperationObject.SetRequestBody should have comment or be unexported (golint)
    • Line 57: warning: exported method OperationObject.AddResponse should have comment or be unexported (golint)
    • Line 61: warning: exported method OperationObject.SetDefaultResponse should have comment or be unexported (golint)
    • Line 65: warning: exported type WithCallbacks should have comment or be unexported (golint)
    • Line 69: warning: exported method WithCallbacks.AddCallback should have comment or be unexported (golint)
    • Line 79: warning: exported function NewCallback should have comment or be unexported (golint)
    • Line 93: warning: exported type Callback should have comment or be unexported (golint)
    • Line 99: warning: exported method Callback.MarshalJSON should have comment or be unexported (golint)
    • Line 103: warning: exported method Callback.UnmarshalJSON should have comment or be unexported (golint)
    • Line 107: warning: exported type CallbackObject should have comment or be unexported (golint)
    • oas/server.go
    • Line 3: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 9: warning: exported type WithServers should have comment or be unexported (golint)
    • Line 13: warning: exported method WithServers.AddServer should have comment or be unexported (golint)
    • Line 20: warning: exported type Server should have comment or be unexported (golint)
    • Line 25: warning: exported method Server.MarshalJSON should have comment or be unexported (golint)
    • Line 29: warning: exported method Server.UnmarshalJSON should have comment or be unexported (golint)
    • Line 33: warning: exported type ServerObject should have comment or be unexported (golint)
    • Line 39: warning: exported method ServerObject.AddVariable should have comment or be unexported (golint)
    • Line 49: warning: exported function NewServerVariable should have comment or be unexported (golint)
    • Line 57: warning: exported type ServerVariable should have comment or be unexported (golint)
    • Line 62: warning: exported method ServerVariable.MarshalJSON should have comment or be unexported (golint)
    • Line 66: warning: exported method ServerVariable.UnmarshalJSON should have comment or be unexported (golint)
    • Line 70: warning: exported type ServerVariableObject should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!