deluan/bring

View on GitHub

Showing 5 of 6 total issues

Function copyImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func copyImage(dest draw.Image, x, y int, src image.Image, sr image.Rectangle, op draw.Op) {
Severity: Minor
Found in layer.go - About 35 mins to fix

    Method layer.Fill has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (l *layer) Fill(r byte, g byte, b byte, a byte, op draw.Op) {
    Severity: Minor
    Found in layer.go - About 35 mins to fix

      Method display.rect has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (d *display) rect(layerIdx int, x int, y int, width int, height int) {
      Severity: Minor
      Found in display.go - About 35 mins to fix

        Function ParseInstruction has 5 return statements (exceeds 4 allowed).
        Open

        func ParseInstruction(raw []byte) (ins *Instruction, err error) {
            var (
                cursor   int
                elements []string
            )
        Severity: Major
        Found in protocol/instruction.go - About 35 mins to fix

          Method session.startReader has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
          Open

          func (s *session) startReader() {
              go func() {
                  for {
                      ins, err := s.tunnel.ReceiveInstruction()
                      if err != nil {
          Severity: Minor
          Found in session.go - About 25 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language