View Full Version : Static Code Analysis Tool for ActionScript

04-17-2008, 07:07 PM

We are trying to use/find a tool that can be run before code review that warns for some of these (there may be others):
Naming conventions are violated.
Not using get / set methods.
Inline methods are used.
Function does not fit in one page (for e.g. function is more than 60 lines)
Not using blocks in if, else, for, ...
Using literals instead of constant variables.

The basic purpose of the whole thing is to be able to simplify maintenance, minimize the risk of making commonly known errors, increase readability, and create a uniform appearance of code and classes.


04-22-2008, 07:28 AM
i have not seen a tool like this yet.
if i had to write a tool like this i would look at the pyparsing library in python

04-24-2008, 01:16 PM
Here is a static analysis tool (using pyparsing) (http://code.google.com/p/asdox/):

The parser skims the source files only looking for things of interest such as class/interface definitions, import statements, JavaDoc tags and member declarations. The parser ignores things such as actual method implementations to avoid overhead.

Maybe it could give you a start on writing such a tool.

Pyparsing has been used for code analysis and code conversion in other cases, see these examples of pyparsing usage at http://pyparsing.wikispaces.com/WhosUsingPyparsing.