I am trying to generate a monthly report base on below factor
- LoC(lines of code)
- Rule Compliance %
- Comment %
- Public Documented API %
- Security Violations
- Violations (excluding Info)
- Duplicated Line %
I tried to check the Entity relation ship in sonar database,all table are independent .
I am not sure from which table I should get the value so as to produce the report .
For the hints below query is mentioned
Hint:
select proj.name as ClassName, -- Class Name for which violation has been found out
proj.long_name as LongName, -- Long Class Name i.e. with package for which violation has been found out
rf.failure_level as ErrorLevel, -- Error level of the violation
rf.message as Violation, -- Cause of Violation
rf.line as LineNumber, -- Line number of the class file
ru.name ViolationName, -- Violation Description
ru.plugin_name PluginType -- Plugin tool by which this error has been detected i.e. findbug, PMD, etc.
-- ,ru.description -- (if violation description is required we can add this column) from projects proj inner join snapshots snap on proj.id = snap.project_id inner join rule_failures rf on rf.snapshot_id = snap.id inner join rules ru on ru.id = rf.rule_id
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…