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.
- id The unique ID for the Analysis.
A URL, returning details about this Analysis in XML format.
- 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.
The number of contributors who made at least one commit to the project source code in the twelve months leading up to and including
The total number of contributors who made at least one commit to the project source code leading up to and including
The number of commits to the project source code in the twelve months leading up to and including
The total number of commits to the project source code leading up to and including
- 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.
- factoids The factoids for the current Analysis will be included under this node.
<factoids> <factoid type="FactoidTeamSizeVeryLarge">Very large, active development team</factoid> <factoid type="FactoidAgeVeryOld">Mature, well-established codebase</factoid> <factoid type="FactoidActivityIncreasing">Increasing year-over-year development activity</factoid> <factoid type="FactoidCommentsLow">Few source code comments</factoid> </factoids>
The language breakdown chart for the current Analysis will be included under this node. The node will have the following children:
- @graphurl_ This is the url to the PNG image that depicts the language breakdown for the current Analysis. The colors referenced in each languages @color attribute will be used in this image.
Not every language will have a entry. Ohloh will will combine languages that do not make up a significant percentage into a aggregate entry “N Other”. This entry can be identified by either its @color, always “000000″ or @id, always “”.
Each language will contain the following data
- @color The color code that Ohloh uses to represent this language on the website. This color is also used in the language breakdown graph image.
- @percentage The percentage of lines of code that the current language represents in the current Analysis
- @id The Ohloh language id.
To get a particular Analysis for a single Project:
A shortcut to the current best Analysis for a single Project can be made by substituting
latest for the analysis ID: