# asteris-llc/converge

### Summary

B
4 hrs

#### Function `alignEdgesInGroup` has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open

``````func alignEdgesInGroup(ctx context.Context, g *graph.Graph, id, group string) (*graph.Graph, error) {
upEdges := withoutRoot(g.UpEdgesInGroup(id, group))
for i, upEdge := range upEdges {
if i > 0 {
dest := highestGroupEdge(g, upEdges[i-1], group)``````

# 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"

#### Function `ResolveDependencies` has 7 return statements (exceeds 4 allowed). Open

``````func ResolveDependencies(ctx context.Context, g *graph.Graph) (*graph.Graph, error) {
logger := logging.GetLogger(ctx).WithField("function", "ResolveDependencies")
logger.Debug("resolving dependencies")

groupLock := new(sync.Mutex)``````

#### Function `getParams` has 5 return statements (exceeds 4 allowed). Open

``````func getParams(g *graph.Graph, id string, node *parse.Node) (out []string, err error) {
var nodeStrings []string
nodeStrings, err = node.GetStrings()
if err != nil {
return nil, err``````

#### Function `getXrefs` has 5 return statements (exceeds 4 allowed). Open

``````func getXrefs(g *graph.Graph, id string, node *parse.Node) (out []string, err error) {
var nodeStrings []string
var calls []string
nodeRefs := make(map[string]struct{})
nodeStrings, err = node.GetStrings()``````

#### Function `ResolveDependencies` has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open

``````func ResolveDependencies(ctx context.Context, g *graph.Graph) (*graph.Graph, error) {
logger := logging.GetLogger(ctx).WithField("function", "ResolveDependencies")
logger.Debug("resolving dependencies")

groupLock := new(sync.Mutex)``````

# 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"