0

I'm working on a huge legacy codebase that uses Bing Maps API as a service provider and I have got the task to scrap Bing which is the foundation of the software and has been referenced through the source code everywhere.

There are no unit tests at all. Very few pages of documentation. Also it's a JavaScript code-base, built on top of ExtJS 3.4, a badly designed custom wrapper around objects to mock classic inheritance and class hierarchies, and Bing being used all over the code and referenced through functions everywhere.

My question is: How should I document and count the references of Bing through out the code? I'm hoping to use this to make a better time estimation, and later, help ease the refactoring process.

I have already started browsing the code-base but I'm not sure what's the best way of documenting references.

closed as too broad by Bart van Ingen Schenau, GlenH7, user22815, Matthew Flynn, Jörg W Mittag Feb 27 '16 at 14:30

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • I appreciate if anyone has any comments in order to improve the quality of the question. – Mahdi Jan 27 '16 at 12:58
  • I think your rep allows to see what close voter thinks – gnat Jan 27 '16 at 14:04
4

If your IDE supports task tagging (e.g. TODO/FIXME comments), then you can use them to annotate your usages on the same line they occur on. Define a new tag (if you can), mark up your source as you go along, and let the IDE do the work of aggregating the results into a neat little report.

As you make changes to the code and remove/consolidate unwanted usages, your report will stay up-to-date. You can also include information after the comment tag and parse it out with regex. For example, including an estimate of effort:

var foo = Bing.bar();  // LEGACY: 3
0

If you're on a Unix-type system, find(1) and grep(1) will enable you to pull together a list of references by file to the calls you want to identify. If you put this in a script, you can run it periodically to verify that you've removed all the references. Just remember to skip any compressed/minified versions of your files, or you'll get duplicate references.

  • It's an Asp.Net/C# project, on windows. Also it has a very complicated inheritance as well, so I have to look for method calls in child classes as well. So can't easily go for this, but thanks for the input. – Mahdi Jan 27 '16 at 17:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.