bus/object.go

Summary

Maintainability
A
2 hrs
Test Coverage
D
65%

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 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

      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 stubObject.UpdateProperty has 5 return statements (exceeds 4 allowed).
        Open

        func (s *stubObject) UpdateProperty(id uint32, sig string, data []byte) error {
            objImpl, ok := (s.impl).(*objectImpl)
            if !ok {
                return fmt.Errorf("unexpected implementation")
            }
        Severity: Major
        Found in bus/object.go - About 35 mins to fix

          should omit 2nd value from range; this loop is equivalent to for uid := range ...
          Open

              for uid, _ := range impl.meta.Methods {
          Severity: Minor
          Found in bus/object.go by golint

          should omit 2nd value from range; this loop is equivalent to for uid := range ...
          Open

              for uid, _ := range o.meta.Methods {
          Severity: Minor
          Found in bus/object.go by golint

          There are no issues that match your filters.

          Category
          Status