Following a ticket opened by a customer to support, a reproducer was shared with the Dev team which allowed to highlight that random issues on a large Cobol file, instead of being detected as moved by SonarQube, were closed and new ones, identical, created.
(see details in Discuss thread)
A piece of the code behind the code move heuristic is indexing issues by line in a MultiMap
Issues are DefaultIssue objects which hashCode method is based solely on DefaultIssue's key field
The Multimap implementation used in code move is Set based
Unfortunately, at this point in the report processing, no DefaultIssue instance has a key yet, which implies that all of them have the same "hashcode", which implies that, when stored in the MultiMap for the same line, only one DefaultIssue instance is actually stored (the first added, which is unpredictable)
The consequence is that when there are multiple issues on the same line, only one of those issues is taken into account by the code move heuristic. Which one is random.