Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:02:41+00:00 2026-05-30T05:02:41+00:00

I am trying to generate a monthly report base on below factor LoC(lines of

  • 0

I am trying to generate a monthly report base on below factor

  1. LoC(lines of code)
  2. Rule Compliance %
  3. Comment %
  4. Public Documented API %
  5. Security Violations
  6. Violations (excluding Info)
  7. 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:02:43+00:00Added an answer on May 30, 2026 at 5:02 am

    You can get The above Information Using The below table.

    1)projects, snapshots , metrics and project_measures. where projects table contain the Projects name . And for each project one snapshot id is created in certain period of time in snapshot table. then from snapshot table take the snapshot id and search it projects_measure table. and search the value of the descibed attribute using metric id.

    select distinct proj.name NAME_OF_PROJ, metric.description Description,
                    projdesc.value, snap.created_at CREATED_DATE
      from projects proj
        inner join snapshots snap on snap.project_id=proj.id 
      inner join (select max(snap2.created_at) as date_of_creation,id from snapshots snap2 
                  where Date(snap2.created_at)   in ('2011-12-20','2012-02-21') 
                   and snap2.project_id  in (5507,35252,9807,38954,23018,32390) 
                  GROUP BY DAY(snap2.created_at),snap2.project_id ) as Lookup on Lookup.id=snap.id 
    
      inner join project_measures projdesc on  projdesc.snapshot_id=snap.id 
      inner join metrics metric on  projdesc.metric_id =metric.id 
      where  metric.id in( 1,2...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to generate a color gradient using ColdFusion. My current code below works
I am trying to generate a report by querying 2 databases (Sybase) in classic
I'm trying to generate some code at runtime where I put in some boiler-plate
I'm trying to generate code coverage reports with EMMA using tests of which some
I'm trying to generate a series of monthly dates from a starting date, which
i´m trying to generate a picture. It should contain a base Picture (JPG, PNG,...)
Trying to generate an RSA Public Key given an APIs modulus and exponent. I'm
I am trying to generate a simple jQuery code snippet in JavaScript and append
im trying to generate a report using CodeIgniter and Datatables.net . Now i'm trying
I'm trying to generate a dropdownlist in my view, like the one below except

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.