api/templates/logger.go
Function DebugTemplate
has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring. Open
Open
func DebugTemplate(w http.ResponseWriter, r *http.Request, tmpl string) {
lastline := 0
linestring := ""
defer func() {
if n := recover(); n != nil {
- 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 DebugTemplatePath
has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring. Open
Open
func DebugTemplatePath(tmpl string, intrf interface{}) {
lastline := 0
linestring := ""
defer func() {
if n := recover(); n != nil {
- 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 DebugTemplate
has 85 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func DebugTemplate(w http.ResponseWriter, r *http.Request, tmpl string) {
lastline := 0
linestring := ""
defer func() {
if n := recover(); n != nil {
Function DebugTemplatePath
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func DebugTemplatePath(tmpl string, intrf interface{}) {
lastline := 0
linestring := ""
defer func() {
if n := recover(); n != nil {
comment on exported function DebugTemplatePath should be of the form "DebugTemplatePath ..." Open
Open
// Gets template string from assets package, and
- Exclude checks
comment on exported function DebugTemplate should be of the form "DebugTemplate ..." Open
Open
// Scans template string and uses data provided from request
- Exclude checks
package comment should be of the form "Package templates ..." Open
Open
// File generated by Gopher Sauce
- Exclude checks
exported var Prod should have comment or be unexported Open
Open
var Prod = true
- Exclude checks