Security-code-scan converter fails silently because token too long
The security-code-scan converter converts msbuild output to JSON. In the uniqueScan function is reads lines using a bufio scanner, by repeatedly calling scanner.Scan. Scanner.Scan returns false when the end of the file is reached, or on error. However, uniqueScan doesn't check for error (would be in scanner.Err()), so it silently continues without reading in the whole file. It outputs a JSON without all the security issues.
The reason the scanner fails for me is that I have very long lines in my msbuild output. I changed the code to print the error, at the end of uniqueScan:
fmt.Println(scanner.Err())
This outputs:
bufio.Scanner: token too long
The line it breaks on is a csc.exe invocation, and the line is 87850 bytes long.