Showing 191 of 191 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

func (p *proxyALRobotPosture) ApplyPosture(postureName string, maxSpeedFraction float32) (bool, error) {
    var ret bool
    args := bus.NewParams("(sf)", postureName, maxSpeedFraction)
    resp := bus.NewResponse("b", &ret)
    err := p.Proxy().Call2("applyPosture", args, resp)
Severity: Major
Found in examples/posture/proxy/posture_proxy.go and 1 other location - About 1 hr to fix
examples/posture/proxy/posture_proxy.go on lines 66..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 132.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

func (s Property) Tuple() *signature.TupleType {
    var tuple signature.TupleType
    tuple.Members = make([]signature.MemberType, 0)
    for _, p := range s.Params {
        tuple.Members = append(tuple.Members,
Severity: Major
Found in meta/idl/interface.go and 1 other location - About 1 hr to fix
meta/idl/interface.go on lines 97..108

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 130.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

func (s Signal) Tuple() *signature.TupleType {
    var tuple signature.TupleType
    tuple.Members = make([]signature.MemberType, 0)
    for _, p := range s.Params {
        tuple.Members = append(tuple.Members,
Severity: Major
Found in meta/idl/interface.go and 1 other location - About 1 hr to fix
meta/idl/interface.go on lines 141..152

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 130.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      func (c *tracedChannel) SendError(msg *net.Message, err error) error {
          hdr := net.NewHeader(net.Error, msg.Header.Service, msg.Header.Object,
              msg.Header.Action, msg.Header.ID)
          mError := net.NewMessage(hdr, errorPaylad(err))
          return c.Send(&mError)
      Severity: Minor
      Found in bus/channel.go and 1 other location - About 55 mins to fix
      bus/channel.go on lines 137..142

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 127.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      func (c *statChannel) SendError(msg *net.Message, err error) error {
          hdr := net.NewHeader(net.Error, msg.Header.Service, msg.Header.Object,
              msg.Header.Action, msg.Header.ID)
          mError := net.NewMessage(hdr, errorPaylad(err))
          return c.Send(&mError)
      Severity: Minor
      Found in bus/channel.go and 1 other location - About 55 mins to fix
      bus/channel.go on lines 111..116

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 127.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      func (p *proxyALTextToSpeech) Say(stringToSay string) error {
          var ret struct{}
          args := bus.NewParams("(s)", stringToSay)
          resp := bus.NewResponse("v", &ret)
          err := p.Proxy().Call2("say", args, resp)
      Severity: Minor
      Found in examples/memory/proxy/memory_proxy.go and 1 other location - About 55 mins to fix
      examples/posture/proxy/posture_proxy.go on lines 126..135

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 123.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      func (p *proxyALRobotPosture) GetPostureFamilyList() ([]string, error) {
          var ret []string
          args := bus.NewParams("()")
          resp := bus.NewResponse("[s]", &ret)
          err := p.Proxy().Call2("getPostureFamilyList", args, resp)
      Severity: Major
      Found in examples/posture/proxy/posture_proxy.go and 2 other locations - About 55 mins to fix
      examples/memory/proxy/memory_proxy.go on lines 98..107
      examples/posture/proxy/posture_proxy.go on lines 102..111

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 123.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      func (p *proxyALRobotPosture) GetPostureList() ([]string, error) {
          var ret []string
          args := bus.NewParams("()")
          resp := bus.NewResponse("[s]", &ret)
          err := p.Proxy().Call2("getPostureList", args, resp)
      Severity: Major
      Found in examples/posture/proxy/posture_proxy.go and 2 other locations - About 55 mins to fix
      examples/memory/proxy/memory_proxy.go on lines 98..107
      examples/posture/proxy/posture_proxy.go on lines 114..123

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 123.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      func (p *proxyALMemory) GetEventList() ([]string, error) {
          var ret []string
          args := bus.NewParams("()")
          resp := bus.NewResponse("[s]", &ret)
          err := p.Proxy().Call2("getEventList", args, resp)
      Severity: Major
      Found in examples/memory/proxy/memory_proxy.go and 2 other locations - About 55 mins to fix
      examples/posture/proxy/posture_proxy.go on lines 102..111
      examples/posture/proxy/posture_proxy.go on lines 114..123

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 123.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      func (p *proxyALRobotPosture) SetMaxTryNumber(pMaxTryNumber int32) error {
          var ret struct{}
          args := bus.NewParams("(i)", pMaxTryNumber)
          resp := bus.NewResponse("v", &ret)
          err := p.Proxy().Call2("setMaxTryNumber", args, resp)
      Severity: Minor
      Found in examples/posture/proxy/posture_proxy.go and 1 other location - About 55 mins to fix
      examples/memory/proxy/memory_proxy.go on lines 51..60

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 123.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func (p *proxyALRobotPosture) GetPosture() (string, error) {
                      var ret string
                      args := bus.NewParams("()")
                      resp := bus.NewResponse("s", &ret)
                      err := p.Proxy().Call2("getPosture", args, resp)
                  Severity: Minor
                  Found in examples/posture/proxy/posture_proxy.go and 1 other location - About 50 mins to fix
                  examples/posture/proxy/posture_proxy.go on lines 54..63

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 119.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func (p *proxyALRobotPosture) GetPostureFamily() (string, error) {
                      var ret string
                      args := bus.NewParams("()")
                      resp := bus.NewResponse("s", &ret)
                      err := p.Proxy().Call2("getPostureFamily", args, resp)
                  Severity: Minor
                  Found in examples/posture/proxy/posture_proxy.go and 1 other location - About 50 mins to fix
                  examples/posture/proxy/posture_proxy.go on lines 138..147

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 119.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language