MikkelHJuul/ld

View on GitHub

Showing 3 of 5 total issues

Method ldService.DeleteRange has 51 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (l ldService) DeleteRange(keyRange *pb.KeyRange, server pb.Ld_DeleteRangeServer) error {
    matcher, err := NewMatcher(keyRange.Pattern)
    if err != nil {
        log.Debugf("Could not compile matcher from patter, %v: %v", keyRange.Pattern, err)
        return err
Severity: Minor
Found in impl/delete.go - About 1 hr to fix

    Method ldService.DeleteRange has 5 return statements (exceeds 4 allowed).
    Open

    func (l ldService) DeleteRange(keyRange *pb.KeyRange, server pb.Ld_DeleteRangeServer) error {
        matcher, err := NewMatcher(keyRange.Pattern)
        if err != nil {
            log.Debugf("Could not compile matcher from patter, %v: %v", keyRange.Pattern, err)
            return err
    Severity: Major
    Found in impl/delete.go - About 35 mins to fix

      Method ldService.Delete has 5 return statements (exceeds 4 allowed).
      Open

      func (l ldService) Delete(_ context.Context, key *pb.Key) (*pb.KeyValue, error) {
          var value []byte
          err := l.DB.Update(func(txn *badger.Txn) (err error) {
              value, err = readSingleFromKey(txn, key)
              if err != nil {
      Severity: Major
      Found in impl/delete.go - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language