cat build-output.txt | sed -rn 's/^.*\[([A-Z]+[0-9]+)\].*$/\1/p' | sort | uniq -c | sort -nr
Explanation:
↑ ↑ ↑ ↑
a b c d
Extracts the warning code (like CS1234
from foo [CS1234]: bar
), discarding
the rest of the line (and all non-matching lines)
sort all codes, so uniq
works as intended
counts unique occurrences for each code
sorts by most-common-first