Preparing report...

Report for github.com/tarent/lib-compose

A+    Excellent!    Found 28 issues across 44 files

Tweet

gofmt93%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


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!


golint47%

Golint is a linter for Go source code.

    • lib-compose/composition/cache_loader.go
    • Line 11: warning: exported type CachingContentLoader should have comment or be unexported (golint)
    • Line 17: warning: exported function NewCachingContentLoader should have comment or be unexported (golint)
    • Line 25: warning: exported method CachingContentLoader.Load should have comment or be unexported (golint)
    • Line 64: warning: exported type ContentWrapper should have comment or be unexported (golint)
    • Line 69: warning: exported method ContentWrapper.Reader should have comment or be unexported (golint)
    • lib-compose/composition/content_merge.go
    • Line 16: warning: exported const LayoutFragmentName should have comment (or a comment on this block) or be unexported (golint)
    • Line 63: warning: exported method ContentMerge.SetDeduplicationStrategy should have comment or be unexported (golint)
    • Line 131: warning: exported method ContentMerge.GetHtml should have comment or be unexported (golint)
    • Line 203: warning: exported method ContentMerge.AddContent should have comment or be unexported (golint)
    • Line 253: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • lib-compose/composition/fetch_definition.go
    • Line 12: warning: exported const MAX_PRIORITY should have comment or be unexported (golint)
    • Line 57: warning: exported const DefaultTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 81: warning: comment on exported function NewFetchDefinition should be of the form "NewFetchDefinition ..." (golint)
    • Line 96: warning: comment on exported method FetchDefinition.WithPriority should be of the form "WithPriority ..." (golint)
    • Line 102: warning: comment on exported method FetchDefinition.FromRequest should be of the form "FromRequest ..." (golint)
    • Line 124: warning: comment on exported method FetchDefinition.WithHeaders should be of the form "WithHeaders ..." (golint)
    • Line 130: warning: comment on exported method FetchDefinition.WithResponseProcessor should be of the form "WithResponseProcessor ..." (golint)
    • Line 136: warning: comment on exported method FetchDefinition.WithName should be of the form "WithName ..." (golint)
    • Line 145: warning: receiver name def should be consistent with previous receiver name fd for FetchDefinition (golint)
    • Line 152: warning: exported method FetchDefinition.IsCacheable should have comment or be unexported (golint)
    • Line 152: warning: receiver name def should be consistent with previous receiver name fd for FetchDefinition (golint)
    • Line 159: warning: exported method FetchDefinition.IsReadableFromCache should have comment or be unexported (golint)
    • Line 159: warning: receiver name def should be consistent with previous receiver name fd for FetchDefinition (golint)
    • Line 187: warning: comment on exported type DefaultErrorHandler should be of the form "DefaultErrorHandler ..." (with optional leading article) (golint)
    • Line 191: warning: exported function NewDefaultErrorHandler should have comment or be unexported (golint)
    • Line 196: warning: exported method DefaultErrorHandler.Handle should have comment or be unexported (golint)
    • lib-compose/composition/file_content_loader.go
    • Line 13: warning: error var ResponseProcessorsNotApplicable should have name of the form ErrFoo (golint)
    • Line 13: warning: exported var ResponseProcessorsNotApplicable should have comment or be unexported (golint)
    • Line 15: warning: exported type FileContentLoader should have comment or be unexported (golint)
    • Line 19: warning: exported function NewFileContentLoader should have comment or be unexported (golint)
    • Line 25: warning: exported method FileContentLoader.Load should have comment or be unexported (golint)
    • lib-compose/composition/html_content_parser.go
    • Line 16: warning: exported const UicRemove should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type HtmlContentParser should have comment or be unexported (golint)
    • Line 28: warning: exported method HtmlContentParser.Parse should have comment or be unexported (golint)
    • Line 145: 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)
    • Line 156: 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)
    • Line 167: 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)
    • Line 175: 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)
    • Line 232: 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)
    • Line 268: 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)
    • Line 288: 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)
    • Line 295: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 318: 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)
    • Line 326: 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)
    • Line 339: warning: exported function ParseHeadFragment should have comment or be unexported (golint)
    • lib-compose/cache/cache.go
    • Line 27: warning: exported type CacheEntry should have comment or be unexported (golint)
    • Line 94: warning: exported method Cache.Get should have comment or be unexported (golint)
    • Line 110: warning: exported method Cache.Set should have comment or be unexported (golint)
    • Line 167: warning: comment on exported method Cache.PurgeEntries should be of the form "PurgeEntries ..." (golint)
    • Line 189: warning: exported method Cache.PurgedKeysAsString should have comment or be unexported (golint)
    • Line 203: warning: exported method Cache.Invalidate should have comment or be unexported (golint)
    • lib-compose/composition/http_content_loader.go
    • Line 16: warning: error var redirectAttemptedError should have name of the form errFoo (golint)
    • Line 21: warning: exported type HttpContentLoader should have comment or be unexported (golint)
    • Line 25: warning: exported function NewHttpContentLoader should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method HttpContentLoader.Load should be of the form "Load ..." (golint)
    • lib-compose/composition/memory_content.go
    • Line 10: warning: exported type MemoryContent should have comment or be unexported (golint)
    • Line 24: warning: exported function NewMemoryContent should have comment or be unexported (golint)
    • Line 33: warning: exported method MemoryContent.MemorySize should have comment or be unexported (golint)
    • Line 50: warning: exported method MemoryContent.Name should have comment or be unexported (golint)
    • Line 54: warning: exported method MemoryContent.RequiredContent should have comment or be unexported (golint)
    • Line 62: warning: exported method MemoryContent.Dependencies should have comment or be unexported (golint)
    • Line 66: warning: exported method MemoryContent.Meta should have comment or be unexported (golint)
    • Line 70: warning: exported method MemoryContent.Head should have comment or be unexported (golint)
    • Line 74: warning: exported method MemoryContent.Body should have comment or be unexported (golint)
    • Line 78: warning: exported method MemoryContent.Tail should have comment or be unexported (golint)
    • Line 82: warning: comment on exported method MemoryContent.BodyAttributes should be of the form "BodyAttributes ..." (golint)
    • Line 87: warning: exported method MemoryContent.BodyAttributesArray should have comment or be unexported (golint)
    • Line 91: warning: exported method MemoryContent.Reader should have comment or be unexported (golint)
    • Line 95: warning: exported method MemoryContent.HttpHeader should have comment or be unexported (golint)
    • Line 99: warning: exported method MemoryContent.HttpStatusCode should have comment or be unexported (golint)
    • lib-compose/util/gzip_handler_test.go
    • Line 121: warning: don't use underscores in Go names; func test_text_handler should be testTextHandler (golint)
    • Line 129: warning: don't use underscores in Go names; func test_binary_handler should be testBinaryHandler (golint)
    • Line 136: warning: don't use underscores in Go names; func test_already_compressed_handler should be testAlreadyCompressedHandler (golint)
    • lib-compose/composition/composition_handler.go
    • Line 16: warning: exported type CompositionHandler should have comment or be unexported (golint)
    • Line 42: warning: exported method CompositionHandler.WithCache should have comment or be unexported (golint)
    • Line 47: warning: comment on exported method CompositionHandler.WithDeduplicationStrategyFactory should be of the form "WithDeduplicationStrategyFactory ..." (golint)
    • Line 217: warning: exported function LogFetchResultLoadingError should have comment or be unexported (golint)
    • Line 225: warning: exported function MetadataForRequest should have comment or be unexported (golint)
    • lib-compose/composition/stylesheet_deduplication.go
    • Line 7: warning: comment on exported type IdentityDeduplicationStrategy should be of the form "IdentityDeduplicationStrategy ..." (with optional leading article) (golint)
    • Line 12: warning: exported method IdentityDeduplicationStrategy.Deduplicate should have comment or be unexported (golint)
    • Line 16: warning: comment on exported type SimpleDeduplicationStrategy should be of the form "SimpleDeduplicationStrategy ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported method SimpleDeduplicationStrategy.Deduplicate should be of the form "Deduplicate ..." (golint)
    • lib-compose/cache/cache_strategy.go
    • Line 13: warning: comment on exported const ReasonRequestMethodPOST should be of the form "ReasonRequestMethodPOST ..." (golint)
    • Line 16: warning: comment on exported const ReasonRequestMethodPUT should be of the form "ReasonRequestMethodPUT ..." (golint)
    • Line 19: warning: comment on exported const ReasonRequestMethodDELETE should be of the form "ReasonRequestMethodDELETE ..." (golint)
    • Line 22: warning: comment on exported const ReasonRequestMethodCONNECT should be of the form "ReasonRequestMethodCONNECT ..." (golint)
    • Line 25: warning: comment on exported const ReasonRequestMethodOPTIONS should be of the form "ReasonRequestMethodOPTIONS ..." (golint)
    • Line 28: warning: comment on exported const ReasonRequestMethodTRACE should be of the form "ReasonRequestMethodTRACE ..." (golint)
    • Line 31: warning: comment on exported const ReasonRequestMethodUnkown should be of the form "ReasonRequestMethodUnkown ..." (golint)
    • Line 34: warning: comment on exported const ReasonRequestNoStore should be of the form "ReasonRequestNoStore ..." (golint)
    • Line 37: warning: comment on exported const ReasonRequestAuthorizationHeader should be of the form "ReasonRequestAuthorizationHeader ..." (golint)
    • Line 40: warning: comment on exported const ReasonResponseNoStore should be of the form "ReasonResponseNoStore ..." (golint)
    • Line 43: warning: comment on exported const ReasonResponsePrivate should be of the form "ReasonResponsePrivate ..." (golint)
    • Line 46: warning: comment on exported const ReasonResponseUncachableByDefault should be of the form "ReasonResponseUncachableByDefault ..." (golint)
    • Line 50: warning: exported var DefaultIncludeHeaders should have comment or be unexported (golint)
    • Line 52: warning: exported var DefaultCacheStrategy should have comment or be unexported (golint)
    • Line 54: warning: exported type CacheStrategy should have comment or be unexported (golint)
    • Line 60: warning: exported function NewCacheStrategyWithDefault should have comment or be unexported (golint)
    • Line 68: warning: exported function NewCacheStrategy should have comment or be unexported (golint)
    • Line 81: warning: comment on exported method CacheStrategy.HashWithParameters should be of the form "HashWithParameters ..." (golint)
    • Line 106: warning: exported method CacheStrategy.IsCacheable should have comment or be unexported (golint)
    • lib-compose/util/forwardedhosthandler.go
    • Line 7: warning: exported const X_FORWARDED_HOST_HEADER_KEY should have comment or be unexported (golint)
    • Line 9: warning: exported type ForwardedHostHandler should have comment or be unexported (golint)
    • Line 13: warning: exported function NewForwardedHostHandler should have comment or be unexported (golint)
    • lib-compose/util/gzip_handler.go
    • Line 20: warning: exported var GzipCompressableTypes should have comment or be unexported (golint)
    • Line 34: warning: comment on exported function NewGzipHandler should be of the form "NewGzipHandler ..." (golint)
    • Line 54: warning: exported type GzipResponseWriter should have comment or be unexported (golint)
    • Line 60: warning: exported function NewGzipResponseWriter should have comment or be unexported (golint)
    • Line 64: warning: exported method GzipResponseWriter.WriteHeader should have comment or be unexported (golint)
    • Line 91: warning: exported method GzipResponseWriter.Close should have comment or be unexported (golint)
    • lib-compose/composition/content_fetcher.go
    • Line 10: warning: exported type FetchResult should have comment or be unexported (golint)
    • Line 17: warning: comment on exported type FetchResults should be of the form "FetchResults ..." (with optional leading article) (golint)
    • Line 77: warning: comment on exported method ContentFetcher.WaitForResults should be of the form "WaitForResults ..." (golint)
    • Line 171: warning: exported method ContentFetcher.Empty should have comment or be unexported (golint)
    • Line 188: warning: exported method ContentFetcher.MetaJSON should have comment or be unexported (golint)
    • lib-compose/composition/interfaces.go
    • Line 15: warning: exported type Fragment should have comment or be unexported (golint)
    • Line 25: warning: exported type ContentLoader should have comment or be unexported (golint)
    • Line 31: warning: exported type ContentParser should have comment or be unexported (golint)
    • Line 36: warning: exported type FetchResultSupplier should have comment or be unexported (golint)
    • Line 47: warning: exported type CacheStrategy should have comment or be unexported (golint)
    • Line 102: warning: exported type ContentV2 should have comment or be unexported (golint)
    • Line 109: warning: exported type ContentMerger should have comment or be unexported (golint)
    • Line 120: warning: exported type ResponseProcessor should have comment or be unexported (golint)
    • Line 126: warning: exported type ErrorHandler should have comment or be unexported (golint)
    • Line 131: warning: exported type Cache should have comment or be unexported (golint)
    • Line 138: warning: exported type StylesheetDeduplicationStrategy should have comment or be unexported (golint)
    • lib-compose/composition/string_fragment.go
    • Line 15: warning: exported function NewStringFragment should have comment or be unexported (golint)
    • Line 22: warning: exported method StringFragment.Content should have comment or be unexported (golint)
    • Line 26: warning: exported method StringFragment.SetContent should have comment or be unexported (golint)
    • Line 30: warning: exported method StringFragment.Stylesheets should have comment or be unexported (golint)
    • Line 34: warning: exported method StringFragment.AddStylesheets should have comment or be unexported (golint)
    • Line 38: warning: exported method StringFragment.Execute should have comment or be unexported (golint)
    • lib-compose/composition/mocks/net/http/mock_http.go
    • Line 11: warning: comment on exported type MockHandler should be of the form "MockHandler ..." (with optional leading article) (golint)
    • Line 22: warning: exported function NewMockHandler should have comment or be unexported (golint)
    • Line 28: warning: exported method MockHandler.EXPECT should have comment or be unexported (golint)

gocyclo95%

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.


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell86%

Misspell Finds commonly misspelled English words