Showing 80 of 191 total issues
Method qiDecoder.Decode
has 13 return statements (exceeds 4 allowed). Open
Open
func (q qiDecoder) Decode(x interface{}) (err error) {
switch v := x.(type) {
case CustomDecoder:
return v.Decode(q)
case BinaryDecoder:
Function generateReceiveMethod
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func generateReceiveMethod(file *jen.File, itf *idl.InterfaceType) error {
writing := make([]jen.Code, 0)
prelude := jen.Comment("action dispatch")
if itf.Name == "Object" {
Method qiDecoder.Decode
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (q qiDecoder) Decode(x interface{}) (err error) {
switch v := x.(type) {
case CustomDecoder:
return v.Decode(q)
case BinaryDecoder:
Function convertFrom
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func convertFrom(v, w reflect.Value) error {
errConversion := fmt.Errorf("Failed to convert %v into %v",
v.Type(), w.Type())
Method client.Call
has 11 return statements (exceeds 4 allowed). Open
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 {
Method Header.Write
has 11 return statements (exceeds 4 allowed). Open
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 {
Function generateObjectInterface
has 11 return statements (exceeds 4 allowed). Open
Open
func generateObjectInterface(itf *InterfaceType, serviceName string,
file *jen.File) error {
definitions := make([]jen.Code, 0)
Function methodBodyBlock
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func methodBodyBlock(itf *idl.InterfaceType, method idl.Method,
methodName string) (*jen.Statement, error) {
writing := make([]jen.Code, 0)
params := make([]jen.Code, 0)
Function generateStubPropertyCallback
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func generateStubPropertyCallback(file *jen.File, itf *idl.InterfaceType) error {
writing := make([]jen.Code, 0)
method := func(m object.MetaMethod, methodName string) error {
Method qiEncoder.value
has 10 return statements (exceeds 4 allowed). Open
Open
func (q qiEncoder) value(v reflect.Value) error {
switch v.Kind() {
case reflect.Interface:
i := v.Interface()
w, ok := i.(BinaryEncoder)
Function authenticateCall
has 10 return statements (exceeds 4 allowed). Open
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 {
Method qiDecoder.sliceValue
has 8 return statements (exceeds 4 allowed). Open
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)
}
Method qiDecoder.mapValue
has 8 return statements (exceeds 4 allowed). Open
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)
}
Function generateStubMethods
has 8 return statements (exceeds 4 allowed). Open
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)
Function generateObjectInterface
has 8 return statements (exceeds 4 allowed). Open
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
Method objectImpl.SetProperty
has 8 return statements (exceeds 4 allowed). Open
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()
Function generateProxyObject
has 8 return statements (exceeds 4 allowed). Open
Open
func generateProxyObject(itf *InterfaceType, serviceName string,
file *jen.File) error {
proxyName := proxyName(serviceName)
generateProxyType(file, serviceName, proxyName, itf)
Avoid deeply nested control flow statements. Open
Open
if err == nil {
err = fmt.Errorf("no progress")
}
Function convertFrom
has 7 return statements (exceeds 4 allowed). Open
Open
func convertFrom(v, w reflect.Value) error {
errConversion := fmt.Errorf("Failed to convert %v into %v",
v.Type(), w.Type())
Method Message.Read
has 7 return statements (exceeds 4 allowed). Open
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 {