doxygen can do that if you use the EXTRACT_ALL option in the doxyfile.cfg .
It can genrate .svg call & includes graphs using graphviz.
​
Another option is Sourcetrail, but this needs a bit more config, espcially if you have an niche toolchain / no makefiles, ...
Not exactly what you want but Sourcetrail is great for getting an overview of code! It parses the whole project and makes it really easy to eg see all functions and all classes and how they are related. Just use that to get a list of all functions then go and add a docstring for each.
It is open source and free!
Try source trail https://www.sourcetrail.com/ and try to draw a picture of the class you understand somewhat. For example you could look at the inheritance hierarchies, or order of construction.
Add some debug messages to it, run it, see how to behaves.
It doesn't really matter in which order you do it, the more time you spend reading and playing with the source code, the more you get familiarity with it.
Gr,
Jan
Sourcetrail actually has an IntelliJ plugin that allows you to sync the view of Sourcetrail and IntelliJ: https://www.sourcetrail.com/documentation/#Clion/IntelliJ
Sourcetrail really is an elaborate "Find all References", which is a feature present in most IDEs. But instead of just showing a result list, we visualize the relationships of all symbols and put our attention at navigation and understanding for our tool. Please watch our intro: https://www.sourcetrail.com/#intro
Additionally we aggregate information in some places, e.g. you can see all relationships between two classes at once, or see the whole inheritance tree for a certain base class. For C++ we can show all template specializations of a certain template type and where they are used, which current IDEs can't do.
Java tende ad essere prolisso e la OOP in certi casi peggiora le cose. La gente che programma in ambito enterprise linguaggi del genere difficilmente riesce a trovare un equilibrio giusto anche perche' spesso i framework che vengono usati hanno dei paradigmi che sono risultati essere non esattamente la scelta migliore, ma ormai e' troppo tardi, sia per gli utenti del framework, che per gli autori.
E' per questo che tool come https://www.sourcetrail.com/ supportano i 2 linguaggi piu' abusati sotto questo aspetto (e aggiungeranno C#).
Detto questo le convenzioni di progetto sono utili e tanto piu' e' grosso, tanto piu' vanno rispettate, ma se vuoi vedere buon codice, probabilmente ti conviene fuggire da Java. Non perche' sia di per se' un linguaggio pessimo, ma perche' le persone che usano un linguaggio lo plasmano oltre la sintassi. Ad esempio Python e Ruby hanno sintassi sommariamente simili eppure tutti i progetti di medie+ dimensioni hanno strutture completamente diverse.
In particolare Java non mi pare brilli (o sia mai brillato) per essere lo stato dell'arte dei framework web.
My approach is usually multi-pronged, and also depends on how familiar I need to get with it - do I need to fix a small issue, use the library or take over maintenance:
hmmm comsi comsa. in theory yes, in practice not so much. not unless I spend a considerable amount of time on it, and even then ... ie, debugging. I used emacs for java for at least 10 years. I have lots of abbrevs, yasnippets and scripts to automate a lot of stuff (getters/setters), i used sourcetrail (https://www.sourcetrail.com/), i had emacs wired to maven to run the common targets etc ... and still ... the vscode experience was drastically better.
more tips for java on emacs: - https://nullprogram.com/blog/2012/08/01/ - https://nullprogram.com/blog/2009/12/06/
it makes me think programming is changing. i have always hated java, but not so much anymore. java becomes much more approachable (even enjoyable) with the right tool, and I can't believe I just wrote that.
I've used pyan to get a high level idea of modules before, though the fork that I used looks unsupported now. SourceTrail is also a really useful exploratory tool.
Willing to bet that this is what you want:
https://www.sourcetrail.com/
If you want to do it piece mail, this does similar:
http://toolchainguru.blogspot.com/2011/03/c-calltrees-in-bash-revisited.html
http://toolchainguru.blogspot.com/2008/07/bash-c-call-trees-and-graphs.html
There's a lot of tools built to spelunk through many depths of source. Sourcetrail, for instance, is one of them. It's just one in a long line of a very old set of tools. There's even some more modern tools like livegrep which can do some cool stuff but only on static-ish codebases. Nothing like what Sourcetrail can do.
Once you hit the OS level, you stop working in IDEs because there's too many things that they try to do that get in your way. I've heard tales that even Google and Microsoft folks who work deep in OS-land don't use IDEs. I've heard the occasional rumor of the systems programmer in Windows that uses Emacs or Vim because it just gets the hell out of the way while still handling huge include chains.
I just wanted to point out that the link "Become a Patreon" on https://www.sourcetrail.com/blog/open_source/ actually refers to the site itself and not to the patreon.
"The only thing that kept bothering us is that open-source projects in general have a tendency to decay if no one has the time to actively maintain them. Over the last couple of years we have acquired a lot of knowledge about Sourcetrail’s codebase and all the expertise that was necessary to create it. So we feel that it would be a waste of knowledge to simply move everything to an open-source repository and walk away. We recently saw other projects that successfully financed even full-time work by setting up a Patreon page. Patreon would make it transparent how much compensation we are receiving and with the respective goals, patrons would see how much time we can put into this project. We think this would be an ideal model for us!"
From their blogpost: https://www.sourcetrail.com/blog/open_source/
Home page for those unfamiliar with it:
> Software developers spend most of their time figuring out existing source code, but common code editing tools offer little help for this task. Debuggers only allow detailed inspection of one narrow code path. 'Find all references' helps you in navigating between files, but doesn't provide the context to see the big picture of all relevant dependencies. Sourcetrail provides both overview and details by combining an interactive dependency graph, a concise code view and efficient code search, all built into an easy-to-use cross-platform developer tool. It supports you in exploring legacy code, understanding the implementation and refactoring the software architecture, making it a fun experience for the whole family!
Not sure if this is quite on topic, but Sourcetrail uses clang/llvm for it's C++ indexer. It collects type information and cross-references during AST-traversal and then offers an interface for exploring this information, combining source code and interactive dependency visualization. It's made to help developers familiarize with code bases.
It's included as sample within the download.
I think the only really interesting part about it is the Minimax algorithm in the ArtificialPlayer class.
Thanks for you feedback!
1) Because it's currently not a portable build, but we can make it one if demanded: https://github.com/CoatiSoftware/SourcetrailBugTracker/issues/505
2) Because it has a commandline API for indexing and this is our current solution to do both with one executable: https://www.sourcetrail.com/documentation/#COMMANDLINE
3) Real-world projects can be very diverse and over time there had to be more and more options added. Do you have any specific suggestions for improvement?
4) It's possible to change column width, but only in the title bar for some reason: https://github.com/CoatiSoftware/SourcetrailBugTracker/issues/506
5 + 6) Our parser is based on clang libTooling which allows for very detailed static analysis by building the full abstract syntax tree (AST), just like a compiler. This gives us information like which specializations of a template exist. About 66% of indexing time is used by clang libTooling to build the AST, the rest is our traversal and data storing. We hope that we can improve indexing time further, but there is a limit to that. If you want less CPU usage, please change the number of "Indexer Threads" in the preferences.
7) Can you please provide us a log file or crash report?
One requirement is that the project can be built with clang. You can configure the target architecture via cross-compilation (https://clang.llvm.org/docs/CrossCompilation.html).
The easiest way for project setup is via a clang Compilation Database. It can be exported from CMake via the CMAKE_EXPORT_COMPILE_COMMANDS flag or from Make by using Bear (https://github.com/rizsotto/Bear). More information in our documentation (https://www.sourcetrail.com/documentation/#CreateAProjectFromCompilationDatabase)
We don't have a sample project with global variables, but that's a use-case that Sourcetrail can help you with. You can easily see where global variables are accessed.
No, it's a separate application not integrated within Visual Studio. You will need setup and index your project within Sourcetrail. But we have Visual Studio plugin that allows for exporting your project configuration: https://www.sourcetrail.com/documentation/#VisualStudio