Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract languages from repo in Azure Devops

I'm trying to figure out which languages are used in a repo in Azure Devops.

GitHub has a nice API for getting this info. They're using Linguist underneath which is perfect for my needs.

When you look at the dashboard in Azure Devops then you see the languages used in the repos.

Does anyone know how that is calculated and how to get that data via the REST API?

Thanks

like image 463
Casper Jensen Avatar asked Jan 27 '23 00:01

Casper Jensen


1 Answers

We show only top 3 languages on project summary page where min language percentage is 10, you can get the detailed information about the languages by calling this API:

https://dev.azure.com/{org}/{project}/_apis/projectanalysis/languagemetrics

And based on my test, detect what kind of language is based on what kind of file extension in the project such as (.js, .cs) and so on.

References:

https://developercommunity.visualstudio.com/content/problem/379275/languages-in-project-overview-prediction-endpoint.html

https://developercommunity.visualstudio.com/content/problem/601612/overview-languages-detected-not-detecting-all-lang.html

Azure DevOps language of git repository?

like image 80
AmanGarg-MSFT Avatar answered Apr 29 '23 01:04

AmanGarg-MSFT