Sonar is considering 2 files with same name but at different path same files

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) 9.9.1-community, scanner version 4.7.0.2747
  • how is SonarQube deployed: Helm
  • what are you trying to achieve Sonar should files at different locations 2 different files.
  • what have you tried so far to achieve this Tried looking for the way sonar indexes the files but couldn’t help.
Webapp:
src/features/Search/pages/ListPage                         |     100 |      100 |     100 |     100 |                                                                                                                                                                                                                                                      
  ListPage.tsx                                              |     100 |      100 |     100 |     100 |                                                                                                                                                                   

Chrome Extension: 
src/features/Search/pages/ListPage                                |     100 |      100 |     100 |     100 |                                                                                                                                                                                             
  ListPage.tsx                                                     |     100 |      100 |     100 |     100 |    

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

How do you know that Sonar is considering 2 files with same name but at different paths the same file? What leads you to believe that is true?

We are using jest to run the tests and generate the coverage report, jest shows full coverage for both the files but sonar is showing full coverage for only one. If you look at the jest logs from the original question and here is the sonar analysis output, I can confirm that both the files have different content as well.


y