ActionScript/Flex/AIR Code Quality Measurement Tools

From a java developer perspective, you would love to have the similar code quality measurement tools for ActionScript/Flex/Air also but there is hardly any single comparable tool available for this. After a long search and analysis, this is what I have found and here we will have a look at what all these tools and different utilities offer.

In this post we will analyze what different code quality metrics on a general basis we would require for ActionScript/Flex/AIR and what are the different available tools to get such metrics.

Code Quality Metrics

We would like to have the metrics to display different information like:

Coding Styles: The metrics which tell us the different coding style violations inside the code.

Coding Standards: The metrics which tell us the different coding standards violations inside the code.

Project level: Total number of packages, interface, classes etc. , the dependencies between different packages and classes and their linking.

Class level: Total number of lines of code, number of functions, cyclomatic complexity, dependencies on other classes etc.

Function level: Total number of lines of code, cyclomatic complexity etc. and coverage tools stating if all the lines of code are fully tested on not.

(This is just on broader level, not covering all the metrics and information which similarly we have for java).

List of Available Tools

The available tools for AcrionScript/Flex/Air code quality measurement are:

flexcover

FlexPMD

FlexCPD

it-depends

asdox

Enterprise IDE Plugin

Apollo

Compiler options

Link-Visualizer

(The list may not be complete, but it is as per my best knowledge which I could find around, Feel free to comment and add to it :)).

Flexcover is a code coverage tool for Flex, AIR and AS3. It incorporates a modified version of the AS3 compiler which inserts extra function calls in the code within the SWF or SWC output file. At runtime, these function calls send information on the application’s code coverage to a separate tool; The modified compiler also emits a separate “coverage metadata” file that describes all the possible packages, classes, functions, code blocks and lines in the code, as well as the names of the associated source code files. “

It is, “Visual browser for class and package dependencies in Flex applications”

“ItDepends is a tool for visually exploring the dependencies between classes and packages in an Adobe Flex application, with the aim of making it easy for developers to understand how their application can be made smaller and/or broken up into dynamically loadable modules.”

It is, “asDox is a actionscript 3 parser for extracting class/interface/method definitions from source files complete with JavaDoc @tags.”

“asDox is an Actionscript 3 parser written in Python. It is based on qDox for Java. 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. The end result of the parser is a very simple document model containing enough information to be useful.”

“The Enterprise IDE Plugin is an architect and developer productivity suite for Adobe(R) Flex (R) Builder 3 designed to simplify and aid the development of Enterprise Applications using Flex Builder 3.”

“It analyzes actionscript code and produces some basic stats: number of files, breakdown of lines of code (comments versus whitespace versus real code), and it counts functions and variables. Not really useful for anything in real life, I was just curious how large the Flex SDK was, so I wanted a way to figure that out.”

Screenshot:

Not sure how useful it is, but see if it gives you some idea to design or develop your own utility.

Most of the above tools are still in the very early stages of development and does not much cater the usefulness in the practical scenarios. There is still a long way to go for these tools to be able to the reach the maturity level which we have for java tools. But still something is better than nothing and of-course we are in the right direction at least to have something going on.

I am planning to cover few of these in details covering different pros and cons and how these fit in actual scenarios. In the mean time feel free to share your related experiences.