Showing 80 of 191 total issues

Method qiDecoder.Decode has 13 return statements (exceeds 4 allowed).
Open

func (q qiDecoder) Decode(x interface{}) (err error) {
    switch v := x.(type) {
    case CustomDecoder:
        return v.Decode(q)
    case BinaryDecoder:
Severity: Major
Found in type/encoding/encoding.go - About 1 hr to fix

    Method qiDecoder.Decode has 55 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (q qiDecoder) Decode(x interface{}) (err error) {
        switch v := x.(type) {
        case CustomDecoder:
            return v.Decode(q)
        case BinaryDecoder:
    Severity: Minor
    Found in type/encoding/encoding.go - About 1 hr to fix

      Function generateReceiveMethod has 55 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func generateReceiveMethod(file *jen.File, itf *idl.InterfaceType) error {
          writing := make([]jen.Code, 0)
      
          prelude := jen.Comment("action dispatch")
          if itf.Name == "Object" {
      Severity: Minor
      Found in meta/stub/stub.go - About 1 hr to fix

        Function convertFrom has 54 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func convertFrom(v, w reflect.Value) error {
        
            errConversion := fmt.Errorf("Failed to convert %v into %v",
                v.Type(), w.Type())
        
        
        Severity: Minor
        Found in type/conversion/conversion.go - About 1 hr to fix

          Method client.Call has 11 return statements (exceeds 4 allowed).
          Open

          func (c *client) Call(cancel <-chan struct{}, serviceID, objectID, actionID uint32,
              payload []byte) ([]byte, error) {
          
              // Do nothing if cancel is already closed.
              if cancel != nil {
          Severity: Major
          Found in bus/client.go - About 1 hr to fix

            Function generateObjectInterface has 11 return statements (exceeds 4 allowed).
            Open

            func generateObjectInterface(itf *InterfaceType, serviceName string,
                file *jen.File) error {
            
                definitions := make([]jen.Code, 0)
            
            
            Severity: Major
            Found in meta/idl/proxy.go - About 1 hr to fix

              Method Header.Write has 11 return statements (exceeds 4 allowed).
              Open

              func (h *Header) Write(w io.Writer) (err error) {
                  wrap := func(field string, err error) error {
                      return fmt.Errorf("write message %s: %s", field, err)
                  }
                  if err = h.writeMagic(w); err != nil {
              Severity: Major
              Found in bus/net/message.go - About 1 hr to fix

                Function methodBodyBlock has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func methodBodyBlock(itf *idl.InterfaceType, method idl.Method,
                    methodName string) (*jen.Statement, error) {
                
                    writing := make([]jen.Code, 0)
                    params := make([]jen.Code, 0)
                Severity: Minor
                Found in meta/stub/stub.go - About 1 hr to fix

                  Function generateStubPropertyCallback has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func generateStubPropertyCallback(file *jen.File, itf *idl.InterfaceType) error {
                  
                      writing := make([]jen.Code, 0)
                  
                      method := func(m object.MetaMethod, methodName string) error {
                  Severity: Minor
                  Found in meta/stub/stub.go - About 1 hr to fix

                    Function authenticateCall has 10 return statements (exceeds 4 allowed).
                    Open

                    func authenticateCall(endpoint net.EndPoint, permissions CapabilityMap) (CapabilityMap, error) {
                    
                        // 1. prepare to receive a capability message
                        filter := func(hdr *net.Header) (matched bool, keep bool) {
                            if hdr.Type == net.Capability {
                    Severity: Major
                    Found in bus/auth.go - About 1 hr to fix

                      Method qiEncoder.value has 10 return statements (exceeds 4 allowed).
                      Open

                      func (q qiEncoder) value(v reflect.Value) error {
                          switch v.Kind() {
                          case reflect.Interface:
                              i := v.Interface()
                              w, ok := i.(BinaryEncoder)
                      Severity: Major
                      Found in type/encoding/encoding.go - About 1 hr to fix

                        Method qiDecoder.mapValue has 8 return statements (exceeds 4 allowed).
                        Open

                        func (q qiDecoder) mapValue(v reflect.Value) error {
                            length, err := basic.ReadInt32(q.r)
                            if err != nil {
                                return fmt.Errorf("failed to read vector size: %w", err)
                            }
                        Severity: Major
                        Found in type/encoding/encoding.go - About 50 mins to fix

                          Function generateObjectInterface has 8 return statements (exceeds 4 allowed).
                          Open

                          func generateObjectInterface(file *jen.File, set *signature.TypeSet,
                              itf *idl.InterfaceType) error {
                          
                              // Proxy and stub shall generate the name method name: reuse
                              // the MetaObject method ForEachMethodAndSignal to get an
                          Severity: Major
                          Found in meta/stub/stub.go - About 50 mins to fix

                            Function generateProxyObject has 8 return statements (exceeds 4 allowed).
                            Open

                            func generateProxyObject(itf *InterfaceType, serviceName string,
                                file *jen.File) error {
                            
                                proxyName := proxyName(serviceName)
                                generateProxyType(file, serviceName, proxyName, itf)
                            Severity: Major
                            Found in meta/idl/proxy.go - About 50 mins to fix

                              Method qiDecoder.sliceValue has 8 return statements (exceeds 4 allowed).
                              Open

                              func (q qiDecoder) sliceValue(v reflect.Value) error {
                                  length, err := basic.ReadInt32(q.r)
                                  if err != nil {
                                      return fmt.Errorf("failed to read vector size: %w", err)
                                  }
                              Severity: Major
                              Found in type/encoding/encoding.go - About 50 mins to fix

                                Function generateStubMethods has 8 return statements (exceeds 4 allowed).
                                Open

                                func generateStubMethods(file *jen.File, itf *idl.InterfaceType) error {
                                
                                    method := func(m object.MetaMethod, methodName string) error {
                                        method := itf.Methods[m.Uid]
                                        err := generateMethodMarshal(file, itf, method, methodName)
                                Severity: Major
                                Found in meta/stub/stub.go - About 50 mins to fix

                                  Method objectImpl.SetProperty has 8 return statements (exceeds 4 allowed).
                                  Open

                                  func (o *objectImpl) SetProperty(name value.Value, newValue value.Value) error {
                                      var nameStr string
                                      stringValue, ok := name.(value.StringValue)
                                      if ok {
                                          nameStr = stringValue.Value()
                                  Severity: Major
                                  Found in bus/object.go - About 50 mins to fix

                                    Method Message.Read has 7 return statements (exceeds 4 allowed).
                                    Open

                                    func (m *Message) Read(r io.Reader) error {
                                    
                                        // Read the complete header, then parse the fields.
                                        b := make([]byte, HeaderSize)
                                        if err := basic.ReadN(r, b, HeaderSize); err != nil {
                                    Severity: Major
                                    Found in bus/net/message.go - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  if err == nil {
                                                      err = fmt.Errorf("no progress")
                                                  }
                                      Severity: Major
                                      Found in type/basic/basic.go - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                    if err != nil {
                                                        return fmt.Errorf("read %v: %w",
                                                            v.Type().Name(), err)
                                                    }
                                        Severity: Major
                                        Found in type/encoding/encoding.go - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language