This report aims to gather data about usage of Global Variabales, jQuery Widgets, and HTML/CSS Selectors throughout and between the four Wikibase core extensions and pseudo extensions (Client, Lib, Repo, View). The scope of this report only includes the core extension and does not include any of the additional Wikibase* extensions.

Global Variables

Usage of global variables in and between Javascript files can be a source of coupling. From the results presented in the sections below it appears that coupling through global variables is most prevalent between the following extensions (highest degree to lowest):

  1. View → Repo
  2. Lib → View
  3. Lib → Repo
  4. Lib → Client

This ranking numbers only consider top level namespaces definitions rather than member variable assignment (i.e. wikibase rather than wikibase.sites).

It is worth to noting that the lowest hanging fruit in terms of decoupling global variables appears to be removing Client's dependency on the wikibase namespace, with only ~7.7% of the total usage share and no other dependencies apart from reliance on MediaWiki core's mw namespace.

Amount and Frequency of Global Variables within Wikibase

In order to check the level of global variable coupling between extensions we asked the following questions:

These questions were answered by searching generated reports from ESLint with only the 'no-undef' rule turned on. This alerts the usage of variables that are not defined in the scope of the current function / file. The linting rules were:

Full ESLint results

eslint-reports.7z

The reports archive is divided into folder for preliminary results, global usage, and usage within each module. Each folder contains the report in a few text formats, and an extra report (linter-result-warnings.txt) which excludes jquery from the environment and includes the rules that were set to warning rather than error.

Global usage (Wikibase)