The Metrics Platform code is conceptualized as a set of libraries, but is currently implemented directly into various product codebases (MediaWiki PHP & JS, and the Android & iOS apps). They should be pulled out into a shared codebase and structured as proper libraries.
The repo mediawiki/libs/metrics-platform has been created for this consolidation.