dosubot[bot] commented on issue #8648:
URL: 
https://github.com/apache/incubator-devlake/issues/8648#issuecomment-3572034738

   <!-- Greeting -->
   Hi @rafaelsilvaaaaa10! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m 
helping the incubator-devlake team.
   
   <!-- Answer -->
   You're correct—DevLake's SonarQube plugin currently stores the coverage 
metric exactly as provided by the SonarQube API, without recalculating or 
combining it with condition coverage. The mapping logic simply parses the 
"coverage" value from SonarQube and assigns it to DevLake's internal model, so 
the displayed coverage in dashboards matches whatever SonarQube returns for 
that field, which is often just line coverage and not the combined formula 
[(source)](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/sonarqube/tasks/shared.go#L144-L212),
 
[(source)](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/sonarqube/tasks/filemetrics_convertor.go#L56-L90).
   
   There is no code or documentation in DevLake that distinguishes between 
"line_coverage" and "coverage" or explains the calculation method. To align 
DevLake with SonarQube's combined coverage formula, you would need to update 
the plugin to ingest both line and condition coverage metrics, store them 
separately, and either calculate the combined coverage in DevLake or display 
both metrics distinctly in dashboards.
   
   If you're planning a PR, focus on updating the ingestion logic to fetch all 
relevant coverage metrics (including conditions), modify the data model to 
store them, and adjust dashboard queries to either use the combined formula or 
show both metrics side-by-side. Let me know if you want a more detailed 
breakdown of the code changes needed!
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/1ab8b093-910b-4b18-9fe8-c319451ed952?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/1ab8b093-910b-4b18-9fe8-c319451ed952?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/1ab8b093-910b-4b18-9fe8-c319451ed952?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/1ab8b093-910b-4b18-9fe8-c319451ed952?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/1ab8b093-910b-4b18-9fe8-c319451ed952?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/1ab8b093-910b-4b18-9fe8-c319451ed952?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/1ab8b093-910b-4b18-9fe8-c319451ed952?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%27re%20correct%E2%80%94DevLake%27s%20SonarQube%20plugin%20currently%20stores%20the%20coverage%20metric%20exactly%20as%20provided%20by%20the%20SonarQube%20API%2C%20without%20recalculating%20or%20combining%20it%20with%20condition%20coverage.%20The%20mapping%20logic%20simply%20parses%20the%20%22coverage%22%20value%20from%20SonarQube%20and%20assigns%20it%20to%20DevLake%27s%20internal%20model%2C%20so%20the%20displayed%20coverage%20in%20dashboards%20matches%20whatever%20SonarQube%20returns%20for%20that%20field%2C%20which%20is%20often%20just%20line%20coverage%20and%20not%20the%20combined%20formula%20%5B%28source%29%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/sonarqube/tasks/shared.go
 
%23L144-L212%29%2C%20%5B%28source%29%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/sonarqube/tasks/filemetrics_convertor.go%23L56-L90%29.%0A%0AThere%20is%20no%20code%20or%20documentation%20in%20DevLake%20that%20distinguishes%20between%20%22line_coverage%22%20and%20%22coverage%22%20or%20explains%20the%20calculation%20method.%20To%20align%20DevLake%20with%20SonarQube%27s%20combined%20coverage%20formula%2C%20you%20would%20need%20to%20update%20the%20plugin%20to%20ingest%20both%20line%20and%20condition%20coverage%20metrics%2C%20store%20them%20separately%2C%20and%20either%20calculate%20the%20combined%20coverage%20in%20DevLake%20or%20display%20both%20metrics%20distinctly%20in%20dashboards.%0A%0AIf%20you%27re%20planning%20a%20PR%2C%20focus%20on%20updating%20the%20ingestion%20logic%20to%20fetch%20all%20relevant%20coverage%20metrics%20%28including%20conditions%29%2C%20modify%20the%20data%20model%20to%20store%20them%2C%20and%20
 
adjust%20dashboard%20queries%20to%20either%20use%20the%20combined%20formula%20or%20show%20both%20metrics%20side-by-side.%20Let%20me%20know%20if%20you%20want%20a%20more%20detailed%20breakdown%20of%20the%20code%20changes%20needed%21)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8648)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to