Showing 80 of 191 total issues

Function Parse has 7 return statements (exceeds 4 allowed).
Open

func Parse(input string) (Type, error) {
    text := []byte(input)

    root, rest := typeSignature(parsec.NewScanner(text))
    if root == nil {
Severity: Major
Found in meta/signature/signature.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

      Function convertFrom has 7 return statements (exceeds 4 allowed).
      Open

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

        Avoid deeply nested control flow statements.
        Open

            } else if logCommand.Used {
                logger(serverURL, logLevel)
            } else if serverCommand.Used {
                server(serverURL)
            } else if traceCommand.Used {
        Severity: Major
        Found in cmd/qiloop/main.go - About 45 mins to fix

          Method signalHandler.RegisterEvent has 7 return statements (exceeds 4 allowed).
          Open

          func (o *signalHandler) RegisterEvent(msg *net.Message, from Channel) error {
          
              buf := bytes.NewBuffer(msg.Payload)
              objectID, err := basic.ReadUint32(buf)
              if err != nil {
          Severity: Major
          Found in bus/signal.go - About 45 mins to fix

            Method proxy.Call2 has 7 return statements (exceeds 4 allowed).
            Open

            func (p proxy) Call2(method string, args Params, ret Response) error {
                methodID, sig, err := p.MetaObject().MethodID(method, args.Signature())
                if err != nil {
                    return err
                }
            Severity: Major
            Found in bus/proxy.go - About 45 mins to fix

              Function GenerateIDL has 6 return statements (exceeds 4 allowed).
              Open

              func GenerateIDL(writer io.Writer, packageName string, objs map[string]object.MetaObject) error {
                  set := signature.NewTypeSet()
              
                  fmt.Fprintf(writer, "package %s\n", packageName)
                  scope := NewScope()
              Severity: Major
              Found in meta/idl/idl.go - About 40 mins to fix

                Method pipeListener.Accept has 6 return statements (exceeds 4 allowed).
                Open

                func (c pipeListener) Accept() (Stream, error) {
                    conn, err := c.l.AcceptUnix()
                    if err != nil {
                        return nil, err
                    }
                Severity: Major
                Found in bus/net/listen.go - About 40 mins to fix

                  Method varReader.Read has 6 return statements (exceeds 4 allowed).
                  Open

                  func (v varReader) Read(r io.Reader) ([]byte, error) {
                      size, err := basic.ReadUint32(r)
                      if err != nil {
                          return nil, fmt.Errorf("read size: %s", err)
                      }
                  Severity: Major
                  Found in meta/signature/reader.go - About 40 mins to fix

                    Function authenticateContinue has 6 return statements (exceeds 4 allowed).
                    Open

                    func authenticateContinue(endpoint net.EndPoint, prefered, resp CapabilityMap) error {
                        newTokenValue, ok := resp[KeyNewToken]
                        if !ok {
                            return fmt.Errorf("missing authentication new token")
                        }
                    Severity: Major
                    Found in bus/auth.go - About 40 mins to fix

                      Method client.Subscribe has 6 return statements (exceeds 4 allowed).
                      Open

                      func (c *client) Subscribe(serviceID, objectID, actionID uint32) (
                          cancel func(), events chan []byte, err error) {
                      
                          abort := make(chan struct{})
                          events = make(chan []byte)
                      Severity: Major
                      Found in bus/client.go - About 40 mins to fix

                        Method Session.client has 6 return statements (exceeds 4 allowed).
                        Open

                        func (s *Session) client(info services.ServiceInfo) (bus.Client, error) {
                            if len(info.Endpoints) == 0 {
                                return nil, fmt.Errorf("empty address list")
                            }
                            s.pollMutex.RLock()
                        Severity: Major
                        Found in bus/session/session.go - About 40 mins to fix

                          Function checkServiceInfo has 6 return statements (exceeds 4 allowed).
                          Open

                          func checkServiceInfo(i ServiceInfo) error {
                              if i.Name == "" {
                                  return fmt.Errorf("empty name not allowed")
                              }
                              if i.MachineId == "" {
                          Severity: Major
                          Found in bus/directory/directory.go - About 40 mins to fix

                            Function convertMap has 6 return statements (exceeds 4 allowed).
                            Open

                            func convertMap(v, w reflect.Value) error {
                                if w.Kind() != reflect.Map {
                                    return fmt.Errorf("Failed to convert map %v into %v",
                                        v.Type(), w.Type())
                                }
                            Severity: Major
                            Found in type/conversion/conversion.go - About 40 mins to fix

                              Function findSignature has 6 return statements (exceeds 4 allowed).
                              Open

                              func findSignature(msg *net.Message, meta *object.MetaObject) string {
                                  if msg.Header.Type == net.Call ||
                                      msg.Header.Type == net.Post ||
                                      msg.Header.Type == net.Reply {
                                      m, ok := meta.Methods[msg.Header.Action]
                              Severity: Major
                              Found in bus/object.go - About 40 mins to fix

                                Method clientObject.handleRegister has 6 return statements (exceeds 4 allowed).
                                Open

                                func (c *clientObject) handleRegister(msg *net.Message, from Channel) error {
                                    buf := bytes.NewBuffer(msg.Payload)
                                    objectID, err := basic.ReadUint32(buf)
                                    if err != nil {
                                        err = fmt.Errorf("cannot read object uid: %s", err)
                                Severity: Major
                                Found in bus/object.go - About 40 mins to fix

                                  Method Message.Write has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (m *Message) Write(w io.Writer) error {
                                  
                                      if uint32(len(m.Payload)) != m.Header.Size {
                                          return fmt.Errorf("invalid message size: %d instead of %d",
                                              len(m.Payload), m.Header.Size)
                                  Severity: Major
                                  Found in bus/net/message.go - About 40 mins to fix

                                    Method signalHandler.UnregisterEvent has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (o *signalHandler) UnregisterEvent(msg *net.Message, from Channel) error {
                                    
                                        buf := bytes.NewBuffer(msg.Payload)
                                        objectID, err := basic.ReadUint32(buf)
                                        if err != nil {
                                    Severity: Major
                                    Found in bus/signal.go - About 40 mins to fix

                                      Function dialPipe has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func dialPipe(name string) (EndPoint, error) {
                                      
                                          addr := gonet.UnixAddr{
                                              Name: name,
                                              Net:  "unix",
                                      Severity: Major
                                      Found in bus/net/endpoint.go - About 40 mins to fix

                                        Function convertSlice has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func convertSlice(v, w reflect.Value) error {
                                            if w.Kind() != reflect.Slice {
                                                return fmt.Errorf("Failed to convert slice %v into %v",
                                                    v.Type(), w.Type())
                                            }
                                        Severity: Major
                                        Found in type/conversion/conversion.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language