Progress since the 2013 ECR and a look to the future
Created by
Jeroen De Dauw
for Wikimedia Deutschland
Licensed CC BY-SA 3.0
Some fun Wikibase.git stats
NCLOC - lines of code
58k → 95k
Classes
Class count: 417 → 602
→ 13% average class NCLOC increase
100 NCLOC → 112 NCLOC
Abstract classes
10% → 6%
Methods
Static: 11.3% → 8.7%
Public: 74% → 68%
NCLOC: 16 → 17
Cyclomatic complexity/methods: 2.12 → 2.02
Cause: MediaWiki hooks, misplaced code
Trend: Slowly decreasing, topic understood
Legacy interfaces:
API, SpecialPage, Action, Job, ContentHandler, Maintenance...
Trend:
Some new introductions, some partial cleanup
Not much change in technical debt
Solution:
Proper DI and disciplined handling of legacy APIs
Trend:
More awareness, though perhaps not enough
New issues still being introduced
Inheritance for code reuse:
API, SpecialPage, Entity, test cases...
Problems:
Complexity, fragility, opacity, immobility, SRP, LSP
Encouraged by lack of lifecycle control
Initial state:
Few, deprecated
Progress:
No new ones added, some removed
Only a few to go
PSR-0 was suggested
We now use PSR-0 or PSR-4
Except in Wikibase.git and part of Diff
Libraries use DI (+factories)
Repo and Client factories
DI approach from ECR implemented in WB Query
Suggested changes:
Decoupling from value objects
Progress:
Implemented nicely for Ask
Now migrating remaining code
ECR
Now
ECR
Now
Guess the NPath complexity!
17,336,096 (way over 9000)
Many function level issues
Method no longer critical, class is though
ECR: Possible SPR violation, split suggested
Status: done
ECR: Highest complexity, good tests recommended
Status: complexity reduced via method extraction
ECR suggested using the strategy pattern
Status: done
Implement DI → partial
Refactor EditEntity (API) using DI → fail
Refactor WB hooks using DI → fail