MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_primary_language

Function get_primary_language

src/summarycode/summarizer.py:203–214  ·  view source on GitHub ↗

Return the most common detected programming language as the primary language.

(programming_language_tallies)

Source from the content-addressed store, hash-verified

201
202
203def get_primary_language(programming_language_tallies):
204 """
205 Return the most common detected programming language as the primary language.
206 """
207 programming_languages_by_count = {
208 entry['count']: entry['value'] for entry in programming_language_tallies
209 }
210 primary_language = None
211 if programming_languages_by_count:
212 highest_count = max(programming_languages_by_count)
213 primary_language = programming_languages_by_count[highest_count] or None
214 return primary_language
215
216
217def get_origin_info_from_top_level_packages(top_level_packages, codebase):

Callers 2

process_codebaseMethod · 0.85

Calls

no outgoing calls

Tested by 1