Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need to know LOC per user for a particular time span

Vitalii Atlassian Team Oct 04, 2016

Based on https://jira.atlassian.com/browse/CRUC-7854

Is there an option to see the LOC for a particular date and for a particular time span?

It is ok if i get the result using a REST hit or even using a mysql DB query.
if there is no such option in crucible, let me know some hint so that i can automate it from backend. 

1 answer

0 votes
Vitalii Atlassian Team Oct 04, 2016

I hope you are using SVN otherwise you won't be able go get LoC statistic.
If you are using Git please start watching FE-3239.

So how you can get LoC information for your SVN repo.
There is a resource that generates charts, tweaking it a bit you can get LoC info for repo/branch/tag/path per day.

//APPLICATION_CONTEXT/fe/locChart.do?context=main&outputtype=json&repname=sanity1&br=MAIN
## Where required params are:
# "context" {string="main"}
# "outputtype" {string="json|image"}
# "repname" {string} repository name

## Optional:
# "author" {string}
# "br" {string} branch name
# "tag" {string} tag name
# "path" {string} path to the file

## Work with "outputtype=image":
# "endDate" {string} end date in ISO format
# "startDate" {string} start date in ISO format

It's not possible to get the day for some particular time span. However charts can be build using startDate and endDate (but it doesn't work for JSON output format type). But it is not a big problem to find a particular date in the array of results.

The response look like this:

[ 
   { 
      "(trunk)":[ 
         { 
            "0":[ 
               { 
                  "loc_change":132,
                  "num_revisions":1,
                  "loc_running_total":132,
                  "revisions_running_total":1,
                  "start_time":1004054400000,
                  "end_time":1004140799999
               },
               { 
                  "loc_change":1,
                  "num_revisions":10,
                  "loc_running_total":133,
                  "revisions_running_total":11,
                  "start_time":1014854400000,
                  "end_time":1014940799999
               },
               { 
                  "loc_change":-1,
                  "num_revisions":1,
                  "loc_running_total":132,
                  "revisions_running_total":12,
                  "start_time":1014940800000,
                  "end_time":1015027199999
               }
            ]
         }
      ]
   }
]

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Statuspage

New feature: Slack notifications for Statuspage

We're excited to announce the release of a long-requested feature on Statuspage. Now visitors to your status page can subscribe to get notified in Slack when you report an incident or maintenance. Th...

81 views 0 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you