forked from TrueCloudLab/frostfs-node
[#148] linter: Add gocognit linter
Code with high cognitive complexity is hard intuitively to understand Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
97c36ed3ec
commit
481a1ca6f3
11 changed files with 18 additions and 13 deletions
|
@ -33,7 +33,7 @@ import (
|
|||
|
||||
var errWrongMessageSeq = errors.New("incorrect message sequence")
|
||||
|
||||
// nolint: funlen
|
||||
// nolint: funlen, gocognit
|
||||
func (s *Service) toPrm(req *objectV2.GetRequest, stream objectSvc.GetObjectStream) (*getsvc.Prm, error) {
|
||||
body := req.GetBody()
|
||||
|
||||
|
@ -200,7 +200,7 @@ func (s *Service) toPrm(req *objectV2.GetRequest, stream objectSvc.GetObjectStre
|
|||
return p, nil
|
||||
}
|
||||
|
||||
// nolint: funlen
|
||||
// nolint: funlen, gocognit
|
||||
func (s *Service) toRangePrm(req *objectV2.GetRangeRequest, stream objectSvc.GetObjectRangeStream) (*getsvc.RangePrm, error) {
|
||||
body := req.GetBody()
|
||||
|
||||
|
@ -426,7 +426,7 @@ func (w *headResponseWriter) WriteHeader(_ context.Context, hdr *object.Object)
|
|||
return nil
|
||||
}
|
||||
|
||||
// nolint: funlen
|
||||
// nolint: funlen, gocognit
|
||||
func (s *Service) toHeadPrm(ctx context.Context, req *objectV2.HeadRequest, resp *objectV2.HeadResponse) (*getsvc.HeadPrm, error) {
|
||||
body := req.GetBody()
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import (
|
|||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
)
|
||||
|
||||
// nolint: funlen
|
||||
// nolint: funlen, gocognit
|
||||
func (s *Service) toPrm(req *objectV2.SearchRequest, stream objectSvc.SearchStream) (*searchsvc.Prm, error) {
|
||||
body := req.GetBody()
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ func TraverseSplitChain(r HeadReceiver, addr oid.Address, h SplitMemberHandler)
|
|||
return err
|
||||
}
|
||||
|
||||
// nolint: funlen
|
||||
// nolint: funlen, gocognit
|
||||
func traverseSplitChain(r HeadReceiver, addr oid.Address, h SplitMemberHandler) (bool, error) {
|
||||
v, err := r.Head(addr)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue