Open llvmbot opened 11 years ago
It looks like shaker_sort is supposed to be stable (http://en.wikipedia.org/wiki/Cocktail_sort), and that the browser-provided sort() is not guaranteed to be stable (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). Patches welcome to fix or replace the sorting algorithm used, but relying on the browser sort is a no-go.
Also, please send patches to cfe-commits instead of posting them on bug reports. Thanks!
assigned to @tkremenek
Extended Description
The sorting of bug table in the scan-build report is not very "stable". In the sense when sorting by "Bug Type", the file names are not grouped together. The filenames popup randomly for the same type of bug.
What will be better is that when sorting by "File" first and then sorting by "Bug Type", the bugs in the same file should be grouped together.
In the clang/tools/scan-build/sorttable.js, shaker_sort was used, but the sort does not preserve previous sort order.
While on the firefox, with the default array sorting function, the previous sort order will be preserved, i.e. after sorting by "File" then by "Bug Type", filenames are grouped up for the same bug type.