Analysis

Analysis

An Analysis is a pre-computed collection of statistics about Project source code and contributors.

An individual Analysis never changes. When a Project’s source code is modified, a completely new Analysis is generated for that Project. Eventually, old analyses are deleted from the database. Therefore, you should always obtain the ID of the best current analysis from the project record before requesting an analysis.

The Analysis object described here contains only a few top-level metrics. Detailed, historical metrics are contained within child objects of an Analysis, which will be exposed through the API at a later date.

Properties
id
The unique ID for the Analysis.
project_id
The unique ID of the Project measured by this Analysis.
updated_at
The time at which this Analysis record was last modified.
logged_at
The time at which Ohloh queried the source control system for the source code measured by this Analysis. All commits which occured at or before this time are included. Note that the Analysis might also include some activity after this time if the project includes many Repositories, because not all Repositories are updated at the same time. The logged_at time is the most pessimistic time among all the Repositories included in the Project.
min_month
Ohloh groups most historical statistics (ActivityFacts and SizeFacts) into monthly totals. min_month indicates the first month for which Ohloh has monthly historical statistics available for this project. This is typically the date of the first project commit, truncated to the beginning of its calendar month. Only the year and month fields are significant.
max_month
The last month for which monthly historical statistics are available for this project. Depending on when this analysis was prepared, max_month usually refers to the current month, but it may be slightly older. Only the year and month fields are significant. Ohloh’s monthly statistics for max_month are usually smaller than other months because the complete month has not yet elapsed, and it reflects ongoing development work.
twelve_month_contributor_count
The number of contributors who made at least one commit to the project source code in the twelve months leading up to and including max_month.
total_code_lines
The most recent total count of all source code lines. Blank lines and comment lines are excluded.
main_language_id
The unique ID of the most common programming language used in this project. XML and HTML are ignored when making this determination.
main_language_name
The name of the most common programming language used in this project. XML and HTML are ignored when making this determination.
URL

To get a particular Analysis for a single Project:

 GET http://www.ohloh.net/projects/{project_id}/analyses/{analysis_id}.xml 

A shortcut to the current best Analysis for a single Project can be made by substituting ‘latest’ for the analysis ID:

GET http://www.ohloh.net/projects/{project_id}/analyses/latest.xml