ActionScript Code Analyzer

I was making a simple experiment about analyzing code and creating view that show linked classes and used functions, it was just experiment, nothing too big. At the end I have made a small application that analyze ActionScript code which give some information about the code has been written.

Application analysis the selected folder and create a simple code metrics, which shows the number of code line in files, blank lines, comments, number of functions, and so on. You can analyze your whole Flex Project or simply some of the classes that you wrote. The idea of detecting number of the lines is to predict the amount of effort that will be required to similar projects or libraries. Of course, this cannot be used to estimate the productivity of the developer. Every programmer thinks different and experienced developer may give same functionality with less code than new programmer. So that is the main reason that it cannot be used for productivity.

On the other hand application shows detailed information about comments, which can help you to locate the files that you have less commented, or not commented at all, so you can return back add comment for future usage.

Here you can find more information about the Code analysis
http://en.wikipedia.org/wiki/Source_lines_of_code

Here is some of the information that application gives;

Summary
Total searched file in the selected directory
Source Files (ActionScript& MXML files)
Total lines of code in application/selected folder
Total blank lines of code in application/selected folder

Comments
Commented Lines (Total number of commented lines)
Single Line Comment ( e.g. //This is a single ilne comment)
Multi Line Comment (e.g. /* This is a multi line commen */)
Code&Comment (e.g. private var arr:Array; \\This line include code&comment )
HTML Comment (e.g )

Primitive Objects
Total number of Number object
Total number of Uint object
Total number of Int object
Total number of String object
Total number of Boolean object

Others
Funcitons (getters and setters are not calculated)
Conditions (if and switch contional statements)
Loops (for, for in, for each, while and do while loops)
Try, Catch Block

And here is the application;

Take Care
Engin Yöyen

5 Responses to “ActionScript Code Analyzer”

  1. Thomas Tourlourat 10 February 2010 at 09:16 #

    That’s a cool idea !
    Thanks ;)

  2. Giulian Drimba 10 February 2010 at 22:56 #

    That’s great!!!

  3. danyal 16 March 2010 at 16:42 #

    Very nice. We need more analysis tools for ActionScript.

    Teşekkürler!

  4. Taylor 14 May 2010 at 21:01 #

    Hi Engin,

    Any chance that you might release the source to your experiment, perhaps as a GitHub or Google Code project? That way, eager folks can continue to improve on it.

    Taylor

  5. Engin Yöyen 2 June 2010 at 10:39 #

    Hi Taylor,
    I would like to add couple more features, and than I would be happy to relase all code. But I am sure that would still take a while.
    Engin!


Leave a Reply