Showing 5 of 6 total issues
Function copyImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func copyImage(dest draw.Image, x, y int, src image.Image, sr image.Rectangle, op draw.Op) {
Method layer.Fill
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (l *layer) Fill(r byte, g byte, b byte, a byte, op draw.Op) {
Method display.rect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (d *display) rect(layerIdx int, x int, y int, width int, height int) {
Function ParseInstruction
has 5 return statements (exceeds 4 allowed). Open
Open
func ParseInstruction(raw []byte) (ins *Instruction, err error) {
var (
cursor int
elements []string
)
Method session.startReader
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
Open
func (s *session) startReader() {
go func() {
for {
ins, err := s.tunnel.ReceiveInstruction()
if err != nil {
- 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"