Last modified: 2013-08-01 09:57:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T52111, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50111 - Code duplication: splitString in DD, DM and DMS parsers
Code duplication: splitString in DD, DM and DMS parsers
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
DataValues (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-24 16:09 UTC by Jeroen De Dauw
Modified: 2013-08-01 09:57 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jeroen De Dauw 2013-06-24 16:09:19 UTC
This commit, which has already been merged, adds a bunch of code duplication: https://gerrit.wikimedia.org/r/#/c/69630/3

The duplication in question is the splitString method in the dd, dm and dms parsers. As far as I can see, the only difference is in the delimiters list, which could easily be made a parameter. These 3 classes are similar and are thus prone to having code that does not differ much. In certain cases this is hard to avoid, or simply not worth it. However in this case it is going a bit far. It'd be better to put this code into its own class and have it take the delimiters as parameter. Even if the 3 coordinate parsers then create a new instance of this thing themselves (tight coupling bla bla bla, but this is already the case).
Comment 1 Gerrit Notification Bot 2013-06-26 07:39:30 UTC
Related URL: https://gerrit.wikimedia.org/r/70593 (Gerrit Change Ic3c72b6d58251e8067e5b93ec369a5f857ae0997)
Comment 2 abraham.taherivand 2013-08-01 09:57:02 UTC
Verified in Wikidata demo July 31th.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links