Please read the origninal post on https://www.kevinpeters.net/the-fastest-way-to-understand-new-code-bases.
The following are direct snippets from the above link.
React.js is a frontend framework that almost every web developer knows by now. What most people do not know is how the codebase is structured and what are the core parts. So let us have a look at it.
npx code-complexity . --limit 20 --sort ratio
Running the command will lead to the following result:
What we can see here is that two sub-packages are probably the most interesting to understand:
Understanding React Fiber and how react-dom’s partial renderer is working will give you a good idea about React’s architecture. A good thing about the code within React is that it is well documented with comments even though it is complex at first.
Where does this technique come from?
This technique of analyzing a codebase originally came from a book that handles refactoring large codebases via a process: Software Design X-Rays by Adam Tornhill. It is a great book and teaches you a lot of ways to structure your code and what parts are worth refactoring. A great book. I think every software engineer should have read it at some point because it will help them to understand a codebase differently. With working on a project, people will get familiar with different parts of the software and of course, they will have their special “area” of code where they are super comfortable. If this code is good and understandable is another question though, that this book tries to answer.