Showing 41 of 59 total issues
Method Snsi.ToSlice
has 75 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (
s *Snsi,
) ToSlice() []string {
snsi := s.Copy()
return []string{
Method Snsi.Copy
has 74 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (
s *Snsi,
) Copy() *Snsi {
d := newSnsi()
d.GFcpBytesSent = atomic.LoadUint64(
Method GFCP.Check
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (
GFcp *GFCP,
) Check() uint32 {
current := CurrentMs()
tsFlush := GFcp.tsFlush
Method FecEncoder.Encode
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (
enc *FecEncoder,
) Encode(
b []byte,
) (
Method UDPSession.Read
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
func (
s *UDPSession,
) Read(
b []byte,
) (
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method GFCP.Send
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
Open
func (
GFcp *GFCP,
) Send(
buffer []byte,
) int {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
Open
if GFcp.incr < mss {
GFcp.incr = mss
}
Avoid deeply nested control flow statements. Open
Open
} else if msg.Addr.String() != src {
atomic.AddUint64(
&DefaultSnsi.GFcpInputErrors,
1,
)
Avoid deeply nested control flow statements. Open
Open
if numshard == 1 {
first = i
}
Avoid deeply nested control flow statements. Open
Open
if !shardsflag[k] {
recovered = append(
recovered,
shards[k],
)
Avoid deeply nested control flow statements. Open
Open
if ret := s.GFcp.Input(
data[fecHeaderSizePlus2:],
true,
s.ackNoDelay,
); ret != 0 {
Avoid deeply nested control flow statements. Open
Open
} else if msg.Addr.String() != src {
atomic.AddUint64(
&DefaultSnsi.GFcpPreInputErrors,
1,
)
Avoid deeply nested control flow statements. Open
Open
} else if k < dec.dataShards {
shards[k] = KxmitBuf.Get().([]byte)[:0]
}
Avoid deeply nested control flow statements. Open
Open
if _itimediff(
sn,
GFcp.rcvNxt,
) >= 0 {
var GFcpSeg Segment
Avoid deeply nested control flow statements. Open
Open
if int(
sz,
) <= len(
r,
) && sz >= 2 {
Avoid deeply nested control flow statements. Open
Open
if dec.rx[i].flag() == KTypeData {
numDataShard++
}
Avoid deeply nested control flow statements. Open
Open
if len(
dec.rx[i].data(),
) > maxlen {
maxlen = len(
dec.rx[i].data(),
Avoid deeply nested control flow statements. Open
Open
if (GFcp.cwnd+1)*mss <= GFcp.incr {
GFcp.cwnd++
}
Method GFCP.Input
has 6 return statements (exceeds 4 allowed). Open
Open
func (
GFcp *GFCP,
) Input(
data []byte,
regular,
Method UDPSession.Read
has 6 return statements (exceeds 4 allowed). Open
Open
func (
s *UDPSession,
) Read(
b []byte,
) (