Function ASCIIschemeForEach
has a Cognitive Complexity of 93 (exceeds 20 allowed). Consider refactoring. Open
func ASCIIschemeForEach(
scheme string,
callback ForEachEvent,
) (
nodes []idx.StakerID,
- 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"
Further reading
Method rows.Optimize
has a Cognitive Complexity of 71 (exceeds 20 allowed). Consider refactoring. Open
func (rr *rows) Optimize() {
for curr, row := range rr.rows {
REFS:
for iRef, ref := range row.Refs {
- 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"
Further reading
Method rows.String
has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
func (rr *rows) String() string {
var (
res strings.Builder
out = func(s string) {
_, err := res.WriteString(s)
- 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"
Further reading
Function DAGtoASCIIscheme
has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring. Open
func DAGtoASCIIscheme(events Events) (string, error) {
events = events.ByParents()
var (
scheme rows
- 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"
Further reading
Function ASCIIschemeForEach
has 152 lines of code (exceeds 50 allowed). Consider refactoring. Open
func ASCIIschemeForEach(
scheme string,
callback ForEachEvent,
) (
nodes []idx.StakerID,
Method rows.String
has 87 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (rr *rows) String() string {
var (
res strings.Builder
out = func(s string) {
_, err := res.WriteString(s)
Function DAGtoASCIIscheme
has 84 lines of code (exceeds 50 allowed). Consider refactoring. Open
func DAGtoASCIIscheme(events Events) (string, error) {
events = events.ByParents()
var (
scheme rows
Method rows.Optimize
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (rr *rows) Optimize() {
for curr, row := range rr.rows {
REFS:
for iRef, ref := range row.Refs {
Method row.Position
has 8 return statements (exceeds 4 allowed). Open
func (r *row) Position(i int) position {
// if left
if i < r.Self {
if i < r.First {
return none