Showing 7 of 11 total issues
Function GoTestStackTrace
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
Open
func GoTestStackTrace(opts *stack.Opts, colored bool) Valve {
const resetFG = ansi.DefaultFG + "\033[m"
var pallete Palette
if colored {
- 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 Golang
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Golang() *cobra.Command {
var (
abspath bool
colored bool
stacked bool
Function GoTestStackTrace
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func GoTestStackTrace(opts *stack.Opts, colored bool) Valve {
const resetFG = ansi.DefaultFG + "\033[m"
var pallete Palette
if colored {
Method Palette.funcColor
has 11 return statements (exceeds 4 allowed). Open
Open
func (p *Palette) funcColor(l stack.Location, main, exported bool) string {
if main {
return p.FuncMain
}
switch l {
Function processInner
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
out io.Writer,
p *Palette,
s stack.Similarity,
pf pathFormat,
c *stack.Snapshot,
Function compile
has 5 return statements (exceeds 4 allowed). Open
Open
func compile() *cobra.Command {
command := cobra.Command{
Use: "compile",
Short: "make sure that all code is compiled",
Long: "Make sure that all code is compiled.",
Function Golang
has 5 return statements (exceeds 4 allowed). Open
Open
func Golang() *cobra.Command {
var (
abspath bool
colored bool
stacked bool