I love using Sonar cloud. I have many repos with sonar analysis configured. I’m looking for a way to generate a summary report ACROSS ALL sonar PROJECTS with the following properties:
Project name
A-E for Bugs
A-E Vulnerabilities
A-E Hotspots reviewed
A-E Code smells
A-E duplications
maybe with some additional useful properties on each grading
If you’re fine with going the API route (and iterating through a list of projects), using GET api/measures/component with the right metricKeys (see documentation on Metric Definitions should help you. ( sqale_rating , security_rating , reliability_rating , security_review_rating , etc.) should help you.
index.js:1
import fetch from "node-fetch";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
Does that help find code that is duplicated across projects? Suppose the same block of code is in each project once. Will that be flagged as duplicated code?
I see that we cannot comment on the following:
It looks like the feature we need was removed. However, it is important to find duplicate code across microservices. If we ignore this type of duplication, the cost of maintenance will increase, and you will have bugs corrected in some and not others. I have seen the cost of a past project “Records” at a previous company raise to millions of dollars, which was greater than what we could sell it for. It has violates “Don’t repeat yourself” DRY principal.