davecom/SwiftGraph

View on GitHub
SwiftGraphSampleApp/AppDelegate.swift

Summary

Maintainability
A
0 mins
Test Coverage

Function addPositionAndChildren has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Wontfix

    func addPositionAndChildren(_ position: NineTailPosition, parent: Int) {
        let index: Int? = ntGraph.indexOfVertex(position)
        if let place = index {
            ntGraph.addEdge(fromIndex: parent, toIndex: place, directed: true)
        } else {
Severity: Minor
Found in SwiftGraphSampleApp/AppDelegate.swift - About 1 hr 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

Function == has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Wontfix

func ==(lhs: NineTailPosition, rhs: NineTailPosition) -> Bool {
    for i in 0..<3 {
        for j in 0..<3 {
            if lhs.positionMatrix[i][j] != rhs.positionMatrix[i][j] {
                return false
Severity: Minor
Found in SwiftGraphSampleApp/AppDelegate.swift - 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

Function awakeFromNib has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Wontfix

    override func awakeFromNib() {
        wantsLayer = true
        let width: CGFloat = self.bounds.size.width
        let height: CGFloat = self.bounds.size.height
        for i in 0..<position.positionMatrix.count {
Severity: Minor
Found in SwiftGraphSampleApp/AppDelegate.swift - 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

There are no issues that match your filters.

Category
Status