Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to analyze an open source code without (or with not enough) documentation? [closed]

I got an open source code, about 15 mb. I want to understand the main algorithm used there. I started analyzing every part of that code, but I think it will take a lot of time. Are there any approaches to make process easier? I didn't do that before, so it is my first experience.

This one, may be someone knows: https://launchpad.net/cuneiform-linux

like image 278
maximus Avatar asked Jan 26 '10 13:01

maximus


People also ask

How do you Analyse source code?

Source code analysis is the automated testing of source code for the purpose of debugging a computer program or application before it is distributed or sold. Source code consists of statements created with a text editor or visual programming tool and then saved in a file.

How do you maintain an open source project?

Always Address Issues One good way to make sure that your project continuously improves is to address issues opened by your peers. No one will show interest in contributing to an open-source project if it doesn't address potential bugs, security issues, or feature addition.

Is an open source static source code analyzer that reports on issues found within application code?

Brakeman. It is a free and open-source code vulnerability scanner and specially designed for the Ruby on Rails applications. It is a static code analyzer that scans the Rails application code to find security issues at any stage during development.


2 Answers

Use Doxygen. It creates an easily browseable cross-reference of the code base in HTML. And it can also create dependency/class diagrams (if the code is OOP).

The code does not need to have specially formatted comments. Although it does help, Doxygen is smart enough to parse the code and figure stuff out on its own. What I like the most is the ability to click on any function name, variable, class etc. and instantly jump to place where it is declared, defined and show list of all places where it is used. I used Doxygen in the past to chew on some rather large code bases (PHP source code, for example) and it saved me a lot of time.

You can also set up Eclipse CDT and import all source files into a project and get a similar code browser. Although, some stuff like function/class index are not available in that case.

like image 85
Milan Babuškov Avatar answered Sep 28 '22 06:09

Milan Babuškov


Since it's C++ code, you may find Source Navigator useful.

like image 28
slebetman Avatar answered Sep 28 '22 07:09

slebetman