Source Code Browsers? 67
patonw asks: "I just started working for a company as a programmer on a project with a huge existing codebase. The person hiring me half-jokingly said that it usually takes new employees two years before they understand the system. What I am looking for is not just an editor/browser but a program that displays functions and classes as connected graphs -- preferably free. I would like to view how programs are structured by function calls and class relations. I have access to several different kinds of platforms/operating systems."
What is it with slashdot-Reenginering Perl. (Score:1, Funny)
I suspect some's trying to reengineer Slashdot's code.
Re:What is it with slashdot-Reenginering Perl. (Score:1)
KDevelop can help (Score:1)
Source Navigator (Score:5, Informative)
http://sourcenav.sourceforge.net/
From the FAQ:
Source-Navigator supports C, C++, Java, Tcl, [incr Tcl], FORTRAN and COBOL, and provides and SDK so that you can write your own parsers.
Use Source-Navigator to:
* Analyze how a change will effect external source modules.
* Find every place in your code where a given function is called.
* Find each file that includes a given header file.
* Use the grep tool to search for a given string in all your source files.
Re:Source Navigator (Score:1)
Re:Source Navigator (Score:3, Interesting)
If there is one, I'd love to see it.
--jeff++
Please learn how to make links. (Score:1, Informative)
(without any spaces put there by Slashdot) yields: Source-Navigator [sourceforge.net]
If that's too much typing for you,
(without any spaces put there by Slashdot) yields: http://sourcenav.sourceforge.net/ [sourceforge.net]
Oh, and for you "Well just right-click on the text and click 'Follow Link'." people, tell me how to open a selected-text link containing extraneous Slashdot spaces
Re:Source Navigator (Score:2)
Windows specific (Score:2)
Microsoft's Visual C++ creates a "code database" containing information about functions and classes.
Version 6 had operations like "call graph" and "caller graph" that graphically showed the function calling sequence from or to a given function.
Unfortunately, Microsoft, in their infinite wisdom, decided to scrap this functionality in version 7 (a.k.a
Theoretically, since the code DB still contains the full info, an add-on could be written to support this functionality but
Doxygen (Score:3, Informative)
Doxygen can also generate LaTeX, and RTF files instead of HTML.
Doxygen for C++ / C etc (Score:4, Informative)
Doxygen [doxygen.org] is a good choice for C++, C, Java, Objective-C, IDL... I used it to get into a ~50K line project a few years ago and have used it regularly whenever I'm forced to use C++... Get Graphviz [att.com] as well so Doxygen can draw pretty pictures for you.
More on Doxygen (Score:2)
In theory you can use Doxygen with any OO language, provided you can get a parser for that language. But I haven't heard a lot about Doxygen outside the C++ community. I imagine Java people mostly stick with JavaDoc [sun.com]
Doxygen (Score:5, Informative)
Unfortunately graph generation is pretty slow, but otherwise it's a fantastic tool.
Meh (Score:4, Insightful)
If the code had decent structure, you'd not be asking this question. But it's a mess. And if you display the mess as a tree structure, it's still a mess. The value is limited.
The best thing I've done is set up etags accross the entire codebase. This way I can at least navigate code easier. But I doubt you will understand anything more from tree graphs.
Re:Meh (Score:3, Interesting)
Where I work we have some home-grown (and not terribly good) tools that help us visualise a project's architecture, from both the design and the implementation point of view. For projects that are good, these two views mesh perfectly. For projects that are crap, they diverge wildly. This gives a you a good idea where a little refactoring might to a lot of good.
Literate programming (Score:3, Interesting)
This sounds a lot like a relatively old, but intriguing idea. "Literate Programming [wikipedia.org]" is exactly what you describe.
It is exciting to write heavily documented code, but I doubt
Debug (Score:4, Insightful)
Re:Debug (Score:3, Interesting)
Have you ever been porting/documenting/something someone elses Symbian C++ code? It's fricking hilarious. Symbian forces certain design principles upon you, but the design is so arcane for the small pieces of software, it makes it next to impossible to decipher someone elses Symbian code.
Especially if the previous developer has adopted the "correct" way of structuring app/ui/doc/view in different files plus followed the UI/Engine guideline too. Ofcourse you must do everything asynchronously with Activ
Re:Debug (Score:2, Informative)
Re:Debug (Score:1)
Re:Debug (Score:3, Insightful)
That can tell you what is actually happening, but not what the original programmer wanted to happen, or why he needs it to happen.
when the comments are unhelpful or wrong, it can be much more useful than reading the code.
Not to be facetious, but how do you know it's the comments, not the code, that are wrong?
Re:Debug (Score:2)
Best example of the above: Mel [jargon.net].
Not to be facetious, but how do you know it's the comments, not the code, that are wrong?
Most coders update the code, not the comments. If the code works, and the comments don't corrospond, it's the comments that are borked, IMO.
Hell, I've even been guilty of this stuff on my own projects, even tho they're only simple PERL stuff. I go back 3
SHriMP/Creole, JQuery (Score:4, Informative)
Currently SHriMP runs both as a standalone application and, using the Creole [thechiselgroup.org] plugin, inside Eclipse [eclipse.org] to augment its existing, extensive code browsing capabilities. There's also a plugin for Protégé [stanford.edu], a Stanford project to build "an ontology editor and a knowledge-base editor" supporting new techologies such as OWL [w3.org].
While Creole is currently Java-specific, SHriMP is a generic framework for code visualization.
JQuery (Score:2)
Re:JQuery (Score:1)
my favorite code bomb.... (Score:3, Informative)
If that doesn't work look up programs that will convert to UML. Since you didn't mention it in your question I'll expand: Unified Modeling Language diagrams are a standardized means of describing the relationships between objects in classes. To any Slashdotters out there in college looking to take a software engineering course, you'll be seeing a lot of UML.
CAST (Score:1)
Roll-your-own (Score:2, Informative)
Re:Roll-your-own (Score:1, Insightful)
Re:Roll-your-own (Score:1)
Like I said, they tend to be language or site-specific. Making such tools generic, well-documented, and with a decent interface would greatly increase their complexity and code-size. That is the value that roll-your-own tools have over "boxed" tools: you only have to consider your cases, not all possible cases it may encounter.
For example, I don't need to have grammar parsing templates for every possible programmi
Source Insight (Score:2)
--...I know... (Score:1, Informative)
Source Navigator (Score:2)
For PHP try this... (Score:4, Informative)
http://phpxref.sourceforge.net/ [sourceforge.net]
lxr (Score:4, Informative)
how about LXR? [sourceforge.net]
I've been using it to browse linux source code lately: here [linux.no]
from the site:
A general purpose source code indexer and cross-referencer that provides web-based browsing of source code with links to the definition and usage of any identifier. Supports multiple languages.
except for lack of syntax hilighting, it works well.
-metric
Re:lxr (Score:2, Informative)
Also, hopefully your codebase runs off some sort of revisi
It takes a *long* time to learn large systems. (Score:4, Insightful)
Complex applications require a huge amount of specialized knowledge in order to understand, and most of that knowledge relates to the application or work process itself, not the technical environment...
KCachegrind... (Score:3, Interesting)
Emacs Code Browser (Score:1)
Of course, if you don't use emacs, it won't be nearly as handy.
Look on sweetcode.org (Score:1)
someone had to say it... (Score:2)
Re:someone had to say it... (Score:2, Funny)
Re:someone had to say it... (Score:1)
Cscope (Score:3, Informative)
In order to stick to the original question, I should also mention that most nontrivial programs end up using dynamic programming styles, and there's no way to graphically display those. I also want to point out is that no source code analyzer is going to do a even a half-assed job at figuring out dynamic relationships, so if your project contains any drivers/vtables/virtual functions, then you're basically S.O.L, and you may as well just use cscope. However, if you really insist on getting a graphical output, check out the free code graphing project [sourceforge.net]. It has a nice picture of the linux kernel [sourceforge.net].
no call graph, but immensely useful for C (Score:2)
(Also comes with vim integration, if you're into that.)
Source Insight (Score:2)
Tools like this for Perl? (Score:2)
However, neither supports Perl. Has anyone seen a tool like this that works on Perl code?
Source Insight (Score:1)
Re:Source Insight (Score:1)
Thanks Everyone (Score:1)
Smalltalk (Score:2)
Codeviz (Score:2)
code browsing (Score:1)