Hacker News new | ask | show | jobs
by ChrisMarshallNY 1718 days ago
That’s great stuff.

Doesn’t do me much good, though. I tend to use a GUI. I will, on occasion, use RegEx to look for stuff, but I generally just stare at code. I use Xcode, and Xcode has a lot of tools for doing things like going to where a method or property is defined (I use that, all the time). It also allows you to quickly see documentation on an entity. You can write code docs in a manner that generates this “quick look” documentation[0].

When I write code, I do so, in a manner that affords review in this manner (because I’m usually the poor schlub that has to look at my code).

Also, for me, there’s really no substitute for runtime analysis, like stepping through running code in a GUI debugger. If you want to trace execution thread, following it in realtime can't be beat.

I’m grateful to have that tool. I realize that it is not available to all; especially when working with a server-based, or embedded, codebase.

I usually write code for Apple systems, which means I have a great deal of control over the runtime environment, and lots of analysis tools. When I work on my server code, I stare at it a lot, and use tools like Charles Proxy and Postman to figure out what’s going on.

[0] https://littlegreenviper.com/miscellany/leaving-a-legacy/

1 comments

Would you know a GUI tool that would use the social network of the functions (who's calling who) to build a visual representation based on metrics of your choice? (ex: eigencentrality)

Ideally it would integrate with an editor to open it on the function you click, and allow other things that make sense to explore a codebase (ex: filter by filename to exclude some files and all the functions they contain)

I've been asked to look at some java code (not my favorite thing). There are about 8000 files, 150 of which seem more important. Having a premade graph to model their relations would let me read the 150 file in order of importance, starting with the most connected one, and maybe even stopping early once I've understood enough of the codebase.

You can likely find more through references here: https://www.nist.gov/itl/ssd/software-quality-group/static-a...
Source Insight has call graphs: https://www.sourceinsight.com/#call-graphs
NDepend seems to be rather sophisticated in this regard: https://blog.ndepend.com/visualize-code-with-software-archit...
There's also static analysis suites like Understand: https://www.scitools.com/features
I know those tools exist, but I haven't used them.

IBM's Rational Rose used to do something like that, but it was big buck$, and I don't think it exists, anymore.