asteris-llc/converge

View on GitHub
prettyprinters/human/human.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method Printer.FinishPP has 52 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (p *Printer) FinishPP(g *graph.Graph) (pp.Renderable, error) {
    tmpl, err := p.template(`{{if .Errors}}Errors:
{{range .Errors}} * {{.}}
{{end}}
{{end}}
Severity: Minor
Found in prettyprinters/human/human.go - About 1 hr to fix

    Method Printer.InitColors has 9 return statements (exceeds 4 allowed).
    Open

    func (p *Printer) InitColors() {
        reset := "\x1b[0m"
        p.funcsMapWrite("bold", p.styled(func(in string) string { return "\x1b[1m" + in + reset }))
        p.funcsMapWrite("black", p.styled(func(in string) string { return "\x1b[30m" + in + reset }))
        p.funcsMapWrite("red", p.styled(func(in string) string { return "\x1b[31m" + in + reset }))
    Severity: Major
    Found in prettyprinters/human/human.go - About 55 mins to fix

      Method Printer.DrawNode has 6 return statements (exceeds 4 allowed).
      Open

      func (p *Printer) DrawNode(g *graph.Graph, id string) (pp.Renderable, error) {
          meta, ok := g.Get(id)
          if !ok {
              return pp.HiddenString(), nil
          }
      Severity: Major
      Found in prettyprinters/human/human.go - About 40 mins to fix

        There are no issues that match your filters.

        Category
        Status