JeffDeCola/my-go-tools

View on GitHub

Showing 10 of 10 total issues

Function buildTableStruct has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
Open

func buildTableStruct(t *table, stuff []string) {

    rowNumber := 0
    columnNumber := 0
    lineNumber := 0
Severity: Minor
Found in markdown-tools/markdown-delimiter-doer/htmlswitch.go - About 3 hrs to fix

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

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

    func buildTableStruct(t *table, stuff []string) {
    
        rowNumber := 0
        columnNumber := 0
        lineNumber := 0
    Severity: Minor
    Found in markdown-tools/markdown-delimiter-doer/htmlswitch.go - About 1 hr to fix

      Function makeHTMLTABLE has 58 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func makeHTMLTABLE(stuff []string, outputFile *os.File) {
      
          t := table{}
      
          buildTableStruct(&t, stuff)
      Severity: Minor
      Found in markdown-tools/markdown-delimiter-doer/htmlswitch.go - About 1 hr to fix

        Function makeHTMLTABLE has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
        Open

        func makeHTMLTABLE(stuff []string, outputFile *os.File) {
        
            t := table{}
        
            buildTableStruct(&t, stuff)
        Severity: Minor
        Found in markdown-tools/markdown-delimiter-doer/htmlswitch.go - About 1 hr to fix

        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

                            if (bold == "bold") && (l < 1) {
                                prefixbold = "<b>"
                                suffixbold = "</b>"
                            }
        Severity: Major
        Found in markdown-tools/markdown-delimiter-doer/htmlswitch.go - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if (l > 0) || (t.rowColumnLine[r][c][l+1] != "") {
                                  linebreak = "<br>"
                              }
          Severity: Major
          Found in markdown-tools/markdown-delimiter-doer/htmlswitch.go - About 45 mins to fix

            Function writeCipherTextFile has 5 return statements (exceeds 4 allowed).
            Open

            func writeCipherTextFile(cipherText string, filename string) error {
            
                // WRITE cipherTex TO A FILE
                log.Trace("Write cipherText to a file")
            
            
            Severity: Major
            Found in cryptography-tools/encryptfile/encryptfile.go - About 35 mins to fix

              Function writeCipherTextFile has 5 return statements (exceeds 4 allowed).
              Open

              func writeCipherTextFile(cipherText string, filename string) error {
              
                  // WRITE cipherTex TO A FILE
                  log.Trace("Write cipherText to a file")
              
              
              Severity: Major
              Found in markdown-tools/markdown-check-links/markdown-check-links.go - About 35 mins to fix

                2: cannot find package "github.com/sirupsen/logrus" in any of:
                Open

                    log "github.com/sirupsen/logrus"
                Severity
                Category
                Status
                Source
                Language