Showing 10 of 10 total issues
Function buildTableStruct
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
Open
func buildTableStruct(t *table, stuff []string) {
rowNumber := 0
columnNumber := 0
lineNumber := 0
- 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 makeTOCEntry
has 86 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func makeTOCEntry(heading string, headingNumber string, inputFilename string) {
//fmt.Println("Working on heading", heading, line)
// STEP 1 ***************************
Function buildTableStruct
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func buildTableStruct(t *table, stuff []string) {
rowNumber := 0
columnNumber := 0
lineNumber := 0
Function makeHTMLTABLE
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func makeHTMLTABLE(stuff []string, outputFile *os.File) {
t := table{}
buildTableStruct(&t, stuff)
Function makeHTMLTABLE
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
func makeHTMLTABLE(stuff []string, outputFile *os.File) {
t := table{}
buildTableStruct(&t, stuff)
- 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
Avoid deeply nested control flow statements. Open
Open
if (bold == "bold") && (l < 1) {
prefixbold = "<b>"
suffixbold = "</b>"
}
Avoid deeply nested control flow statements. Open
Open
if (l > 0) || (t.rowColumnLine[r][c][l+1] != "") {
linebreak = "<br>"
}
Function writeCipherTextFile
has 5 return statements (exceeds 4 allowed). Open
Open
func writeCipherTextFile(cipherText string, filename string) error {
// WRITE cipherTex TO A FILE
log.Trace("Write cipherText to a file")
Function writeCipherTextFile
has 5 return statements (exceeds 4 allowed). Open
Open
func writeCipherTextFile(cipherText string, filename string) error {
// WRITE cipherTex TO A FILE
log.Trace("Write cipherText to a file")
2: cannot find package "github.com/sirupsen/logrus" in any of: Open
Open
log "github.com/sirupsen/logrus"
- Exclude checks