ctcpip/netrisse

View on GitHub

Showing 8 of 8 total issues

Method shape.move has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring.
Open

func (s *shape) move(d direction) bool {

    booContinue, booLock := true, false
    sNew := copyShape(s)

Severity: Minor
Found in shape.go - About 2 hrs 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

Method shape.setPosition has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
Open

func (s *shape) setPosition() {

    var booStartOver bool
    var currCoords point
    position := make(points, 0, 4)
Severity: Minor
Found in shape.go - About 2 hrs 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

Method keyboard.read has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
Open

func (k *keyboard) read() {

loopyMcLoopface:
    for {

Severity: Minor
Found in keyboard.go - About 2 hrs 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

Method shape.move has 71 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (s *shape) move(d direction) bool {

    booContinue, booLock := true, false
    sNew := copyShape(s)

Severity: Minor
Found in shape.go - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                            if s.centerPosition[1] < currCoords[1] {
                                s.yOffset -= currCoords[1] - s.centerPosition[1]
                            } else {
                                s.yOffset += s.centerPosition[1] - currCoords[1]
                            }
    Severity: Major
    Found in shape.go - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if s.move(ROTATE) {
                              //g.timer.Reset(g.interval)
                          }
      Severity: Major
      Found in keyboard.go - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if s.centerPosition[0] < currCoords[0] {
                                    s.xOffset -= currCoords[0] - s.centerPosition[0]
                                } else {
                                    s.xOffset += s.centerPosition[0] - currCoords[0]
                                }
        Severity: Major
        Found in shape.go - About 45 mins to fix

          TODO found
          Open

              // TODO: parse command line args
          Severity: Minor
          Found in app.go by fixme
          Severity
          Category
          Status
          Source
          Language