Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Why don't many code review tools seem to be syntax aware or provide more in-depth analysis of changes? Is it simply too hard to do?

I find this to be a major hole of most programmer's toolkits. From what I have seen, which admittedly is not much, code review tools just compare code line-by-line with many of them not even being able to do syntax highlighting.

Is there a solution out there that is smart enough to offer file-level, method-level code review/comparison? One of the simple problems I have is that methods get re-ordered in code and my code review software breaks down completely, but they should be able to do so much more.

I'm interested in others opinions/knowledge on the topic of code review/comparison tools.

share|improve this question
    
I definitely think there is a market for tools that work at the level of the abstract syntax tree, e.g. code manipulation, highlighting changes... The skills needed to write parsers and understand the underlying structure of code may have been lacking, but it seems the advent of intellisense and refactoring tools in mainstream IDEs have changed that. –  Joh Sep 17 '11 at 8:14

2 Answers 2

Code review tools are tools designed to be used with any programming language.

This means that in order to add file-level and/or method-level comparisons, they will need to understand the context of the language.

This in turn means both knowing about all possible languages and having a parser for them.

All of which are very difficult and error prone. So, for a commercial enterprise the question would be - which language to support first. How well? For a free option, the fact is that such a thing will take a very long time to do, even for one language.

Having a line-by-line option covers most needs already, so people don't try more.

share|improve this answer
    
Just my opinion. There should be tools that parse source files of a particular language and emit a marked-up file which tags each token or symbol with their type and identity. A code review tool can then display the text part, and use the additional markup info for source line matching and highlighting. –  rwong Sep 16 '11 at 19:22
    
@rwong - But first, the code review tool would need to determine the language. This might not be trivial, depending on the contents of the file, the language in question and file name. –  Oded Sep 16 '11 at 19:24
    
The parser tool will have to be bought separately. –  rwong Sep 16 '11 at 19:36
    
I have to disagree completely, it's really not a difficult problem. This site and stackoverflow use prettify - a simple syntax highlighter in Javascript that makes good guesses on which language is used. When it can't find a good match, it doesn't highlight. –  Eran Galperin Sep 16 '11 at 19:43
    
@Eran - Many code review products do highlight. What they don't do is understand the context of the changes, not does the SO code highlighter. –  Oded Sep 16 '11 at 19:45

A solution (that we might be able to test soon enough built-in in VS) is a deep integration within the IDE. the IDE is already able to do all the things you are considering as missing or not working actually :

  • Syntax awareness
  • Project hierarchy for file operations
  • Data structure map for moved code matching

The downside, is that such tool will be binded to the languages supported by the IDE, and as such could limits its universality.

There are already some plug-ins for different IDE available. I didn't tested them, but provide link for examples of existing solutions :

Jupiter - Eclipse (SO Related Question)

TeamReview - TFS / VS

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.