i-love-flamingo / flamingo

Flamingo Framework and Core Library. Flamingo is a go based framework to build pluggable applications. Focus is on clean architecture, maintainability and operation readiness.

Home Page:http://www.flamingo.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix all linter issues

bastianccm opened this issue · comments

  • file=app.go,line=101,col=1::calculated cyclomatic complexity for function NewApplication is 17, max is 10 (cyclop)
  • file=app.go,line=121,col=55::comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
  • file=app.go,line=177,col=15::err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("app: context %q not found", *flamingoContext)" (goerr113)
  • file=app.go,line=221,col=2::variable name 'i' is too short for the scope of its usage (varnamelen)
  • file=app.go,line=235,col=9::error returned from external package is unwrapped: sig: func (*github.com/spf13/cobra.Command).Execute() error (wrapcheck)
  • file=app.go,line=238,col=15::parameter name 'of' is too short for the scope of its usage (varnamelen)
  • file=app.go,line=265,col=14::mnd: Magic number: 25, in detected (gomnd)
  • file=app.go,line=271,col=55::parameter name 'to' is too short for the scope of its usage (varnamelen)
  • file=app.go,line=343,col=14::G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
  • file=app.go,line=364,col=20::parameter name 'a' is too short for the scope of its usage (varnamelen)
  • file=app.go,line=373,col=8::comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
  • file=app.go,line=391,col=10::error returned from external package is unwrapped: sig: func net.Listen(network string, address string) (net.Listener, error) (wrapcheck)
  • file=app.go,line=402,col=10::error returned from external package is unwrapped: sig: func (*net/http.Server).ServeTLS(l net.Listener, certFile string, keyFile string) error (wrapcheck)
  • file=app.go,line=405,col=9::error returned from external package is unwrapped: sig: func (*net/http.Server).Serve(l net.Listener) error (wrapcheck)
  • file=core/auth/example/custom/oidc.go,line=30,col=17::error returned from external package is unwrapped: sig: func (*flamingo.me/dingo.Injector).RequestInjection(object interface{}) error (wrapcheck)
  • file=core/auth/example/custom/oidc.go,line=72,col=15::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no customOidcBroker loggedIn flag")" (goerr113)
  • file=core/auth/example/custom/static.go,line=30,col=16::error returned from external package is unwrapped: sig: func (flamingo.me/flamingo/v3/framework/config.Map).MapInto(out interface{}) error (wrapcheck)
  • file=core/auth/example/custom/static.go,line=74,col=15::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no identity stored")" (goerr113)
  • file=core/auth/example/custom/static.go,line=94,col=34::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no user set")" (goerr113)
  • file=core/auth/fake/identifier.go,line=86,col=15::error returned from external package is unwrapped: sig: func (flamingo.me/flamingo/v3/framework/config.Map).MapInto(out interface{}) error (wrapcheck)
  • file=core/auth/fake/identifier.go,line=126,col=2::variable name 't' is too short for the scope of its usage (varnamelen)
  • file=core/auth/fake/identifier.go,line=156,col=39::parameter name 'r' is too short for the scope of its usage (varnamelen)
  • file=core/auth/fake/identifier_test.go,line=1,col=9::package should be fake_test instead of fake (testpackage)
  • file=core/auth/fake/identifier_test.go,line=48,col=1::Function Test_Identifier_Authenticate missing the call to method parallel
  • file=core/auth/fake/identifier_test.go,line=55,col=6::Test_Identifier_Callback's subtests should call t.Parallel (tparallel)
  • file=core/auth/fake/identifier_test.go,line=115,col=18::test helper function should start from t.Helper() (thelper)
  • file=core/auth/fake/identifier_test.go,line=161,col=18::test helper function should start from t.Helper() (thelper)
  • file=core/auth/fake/identifier_test.go,line=173,col=2::Range statement for test Test_Identifier_Callback missing the call to method parallel in test Run
  • file=core/auth/fake/identifier_test.go,line=205,col=9::test helper function should start from t.Helper() (thelper)
  • file=core/auth/http/http.go,line=22,col=2::variable name 'i' is too short for the scope of its usage (varnamelen)
  • file=core/auth/http/http.go,line=29,col=15::error returned from external package is unwrapped: sig: func (flamingo.me/flamingo/v3/framework/config.Map).MapInto(out interface{}) error (wrapcheck)
  • file=core/auth/http/http.go,line=57,col=15::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no basic auth given")" (goerr113)
  • file=core/auth/http/http.go,line=64,col=14::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("invalid credentials")" (goerr113)
  • file=core/auth/http/http_test.go,line=1,col=9::package should be http_test instead of http (testpackage)
  • file=core/auth/http/http_test.go,line=12,col=1::Function TestHTTPBasicAuthIdentifier missing the call to method parallel
  • file=core/auth/http/http_test.go,line=24,col=2::Function TestHTTPBasicAuthIdentifier has missing the call to method parallel in the test run
  • file=core/auth/http/http_test.go,line=33,col=2::Function TestHTTPBasicAuthIdentifier has missing the call to method parallel in the test run
  • file=core/auth/http/http_test.go,line=41,col=2::Function TestHTTPBasicAuthIdentifier has missing the call to method parallel in the test run
  • file=core/auth/mock/identity.go,line=65,col=9::error returned from external package is unwrapped: sig: func encoding/json.Unmarshal(data []byte, v any) error (wrapcheck)
  • file=core/auth/mock/identity.go,line=76,col=9::error returned from external package is unwrapped: sig: func encoding/json.Unmarshal(data []byte, v any) error (wrapcheck)
  • file=core/auth/module_test.go,line=1,col=9::package should be auth_test instead of auth (testpackage)
  • file=core/auth/module_test.go,line=9,col=1::Function TestModule missing the call to method parallel
  • file=core/auth/oauth/claimset.go,line=34,col=15::error returned from external package is unwrapped: sig: func encoding/json.Marshal(v any) ([]byte, error) (wrapcheck)
  • file=core/auth/oauth/claimset_test.go,line=1,col=9::package should be oauth_test instead of oauth (testpackage)
  • file=core/auth/oauth/claimset_test.go,line=10,col=1::Function TestClaimSet_AddVoluntaryClaim missing the call to method parallel
  • file=core/auth/oauth/claimset_test.go,line=22,col=1::Function TestClaimSet_AddClaimWithValue_Essential missing the call to method parallel
  • file=core/auth/oauth/claimset_test.go,line=34,col=1::Function TestClaimSet_AddClaimWithValue_Voluntary missing the call to method parallel
  • file=core/auth/oauth/claimset_test.go,line=46,col=1::Function TestClaimSet_AddClaimWithValues_Essential missing the call to method parallel
  • file=core/auth/oauth/claimset_test.go,line=58,col=1::Function TestClaimSet_AddClaimWithValues_Voluntary missing the call to method parallel
  • file=core/auth/oauth/module_test.go,line=10,col=1::Function TestModule_Configure missing the call to method parallel
  • file=core/auth/oauth/oauth.go,line=75,col=15::error returned from external package is unwrapped: sig: func github.com/coreos/go-oidc/v3/oidc.NewProvider(ctx context.Context, issuer string) (*github.com/coreos/go-oidc/v3/oidc.Provider, error) (wrapcheck)
  • file=core/auth/oauth/oauth.go,line=111,col=14::err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("can not identify call, last error: %#w", err)" (goerr113)
  • file=core/auth/oauth/oauth.go,line=139,col=9::error returned from external package is unwrapped: sig: func (*github.com/coreos/go-oidc/v3/oidc.IDToken).Claims(v interface{}) error (wrapcheck)
  • file=core/auth/oauth/oidc.go,line=119,col=15::error returned from external package is unwrapped: sig: func github.com/coreos/go-oidc/v3/oidc.NewProvider(ctx context.Context, issuer string) (*github.com/coreos/go-oidc/v3/oidc.Provider, error) (wrapcheck)
  • file=core/auth/oauth/oidc.go,line=235,col=25::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no sessiondata")" (goerr113)
  • file=core/auth/oauth/oidc.go,line=241,col=25::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("broken sessiondata")" (goerr113)
  • file=core/auth/oauth/oidc.go,line=266,col=20::error returned from interface method should be wrapped: sig: func (golang.org/x/oauth2.TokenSource).Token() (*golang.org/x/oauth2.Token, error) (wrapcheck)
  • file=core/auth/oauth/oidc.go,line=275,col=20::error returned from external package is unwrapped: sig: func (*github.com/coreos/go-oidc/v3/oidc.IDTokenVerifier).Verify(ctx context.Context, rawIDToken string) (*github.com/coreos/go-oidc/v3/oidc.IDToken, error) (wrapcheck)
  • file=core/auth/oauth/oidc.go,line=299,col=9::error returned from external package is unwrapped: sig: func encoding/json.Unmarshal(data []byte, v any) error (wrapcheck)
  • file=core/auth/oauth/oidc.go,line=409,col=1::calculated cyclomatic complexity for function Callback is 17, max is 10 (cyclop)
  • file=core/auth/oauth/oidc.go,line=412,col=34::err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("OpenID Connect error: %q (%q)", errString, errDetails)" (goerr113)
  • file=core/auth/oauth/oidc.go,line=417,col=34::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no state in request")" (goerr113)
  • file=core/auth/oauth/oidc.go,line=420,col=34::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("state mismatch")" (goerr113)
  • file=framework/web/handler.go,line=170,col=12::err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("action for method %q not found and no \"any\" fallback", req.Request().Method)" (goerr113)
  • file=framework/web/handler.go,line=188,col=2::if statements should only be cuddled with assignments used in the if statement itself (wsl)
  • file=framework/web/handler.go,line=215,col=3::defer statements should only be cuddled with expressions on same variable (wsl)
  • file=framework/web/path.go,line=134,col=18::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no regex found")" (goerr113)
  • file=framework/web/path.go,line=193,col=1::calculated cyclomatic complexity for function NewPath is 12, max is 10 (cyclop)
  • file=framework/web/path.go,line=205,col=16::err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("path %q corrupted", path)" (goerr113)
  • file=framework/web/path.go,line=216,col=4::append only allowed to cuddle with appended value (wsl)
  • file=framework/web/path.go,line=224,col=4::append only allowed to cuddle with appended value (wsl)
  • file=framework/web/path.go,line=318,col=4::only cuddled expressions if assigning variable or using from line above (wsl)
  • file=framework/web/path_test.go,line=1,col=9::package should be web_test instead of web (testpackage)
  • file=framework/web/registry.go,line=80,col=33::param any has same name as predeclared identifier (predeclared)
  • file=framework/web/registry.go,line=193,col=6::variable name 'h' is too short for the scope of its usage (varnamelen)
  • file=framework/web/registry.go,line=228,col=17::mnd: Magic number: 2, in detected (gomnd)
  • file=framework/web/registry.go,line=236,col=1::calculated cyclomatic complexity for function parseParams is 14, max is 10 (cyclop)
  • file=framework/web/registry.go,line=253,col=4::branch statements should not be cuddled if block has more than two lines (wsl)
  • file=framework/web/registry.go,line=306,col=1::cognitive complexity 60 of func (*RouterRegistry).Reverse is high (> 30) (gocognit)
  • file=framework/web/registry.go,line=407,col=13::err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf("reverse for %q not found, parameters: %v", name, params)" (goerr113)
  • file=framework/web/registry.go,line=429,col=1::calculated cyclomatic complexity for function matchRequest is 11, max is 10 (cyclop)
  • file=framework/web/registry.go,line=450,col=5::variable any has same name as predeclared identifier (predeclared)
  • file=framework/web/registry.go,line=476,col=2::if len(matched.handler.params) > 0 has complex nested blocks (complexity: 6) (nestif)
  • file=framework/web/registry.go,line=482,col=11::ifElseChain: rewrite if-else to switch statement (gocritic)
  • file=framework/web/registry_test.go,line=1,col=9::package should be web_test instead of web (testpackage)
  • file=framework/web/registry_test.go,line=144,col=32::should rewrite http.NewRequestWithContext or add (*Request).WithContext (noctx)
  • file=framework/web/result.go,line=158,col=45::parameter name 'w' is too short for the scope of its usage (varnamelen)
  • file=framework/web/result.go,line=180,col=1::deprecatedComment: use Deprecated: (note the casing) instead of deprecated: (gocritic)
  • file=framework/web/result.go,line=200,col=58::parameter name 'w' is too short for the scope of its usage (varnamelen)
  • file=framework/web/result.go,line=202,col=10::err113: do not define dynamic errors, use wrapped static errors instead: "errors.New("no reverserouter available")" (goerr113)
  • file=framework/web/result.go,line=330,col=1::calculated cyclomatic complexity for function Apply is 12, max is 10 (cyclop)
  • file=framework/web/result.go,line=336,col=2::if req != nil && r.engine != nil has complex nested blocks (complexity: 7) (nestif)
  • file=framework/web/result.go,line=495,col=1::calculated cyclomatic complexity for function ApplyHeaders is 13, max is 10 (cyclop)
  • file=framework/web/router.go,line=153,col=9::G114: Use of net/http serve function that has no support for setting timeouts (gosec)
  • file=framework/web/router.go,line=184,col=27::parameter name 'to' is too short for the scope of its usage (varnamelen)
  • file=framework/web/router.go,line=211,col=41::parameter name 'to' is too short for the scope of its usage (varnamelen)
  • file=framework/web/router_test.go,line=169,col=33::should rewrite http.NewRequestWithContext or add (*Request).WithContext (noctx)
  • file=framework/web/router_test.go,line=512,col=29::should rewrite http.NewRequestWithContext or add (*Request).WithContext (noctx)
  • file=framework/web/routescmd.go,line=57,col=43::mnd: Magic number: 60, in detected (gomnd)
  • file=framework/web/routescmd.go,line=58,col=3::use of fmt.Printf forbidden by pattern ^(fmt\.Print(|f|ln)|print|println)$ (forbidigo)
  • file=framework/web/routescmd.go,line=90,col=3::use of fmt.Printf forbidden by pattern ^(fmt\.Print(|f|ln)|print|println)$ (forbidigo)
  • file=framework/web/routescmd.go,line=95,col=2::Consider pre-allocating keys (prealloc)
  • file=framework/web/sessionstore.go,line=34,col=2::only one cuddle assignment allowed before switch statement (wsl)
  • file=framework/web/sessionstore.go,line=106,col=1::calculated cyclomatic complexity for function Save is 11, max is 10 (cyclop)
  • file=framework/web/sessionstore.go,line=115,col=2::variable name 'gs' is too short for the scope of its usage (varnamelen)
  • file=framework/web/templatefunctions.go,line=23,col=3::variable name 'r' is too short for the scope of its usage (varnamelen)
  • file=framework/web/utils.go,line=9,col=25::wrapperFunc: use strings.ReplaceAll method in strings.Replace(strings.Replace(title, "/", "_", -1), " ", "-", -1) (gocritic)
  • file=framework/web/utils.go,line=10,col=8::wrapperFunc: use strings.ReplaceAll method in strings.Replace(url, "-_", "-", -1) (gocritic)
  • file=framework/web/utils.go,line=11,col=8::wrapperFunc: use strings.ReplaceAll method in strings.Replace(url, "%", "-", -1) (gocritic)
  • file=framework/web/utils.go,line=12,col=2::only one cuddle assignment allowed before for statement (wsl)
  • file=framework/web/utils.go,line=13,col=9::wrapperFunc: use strings.ReplaceAll method in strings.Replace(url, "--", "-", -1) (gocritic)