AS3V Preview

AS3V Here is the first preview of what AS3V looks like in Eclipse. I have written about 30 rules which include cyclomatic complexity checks and unreachable code detection. Most of the time was getting AS3V to link against the asc.jar from the Flex SDK inside Eclipse which is a real nightmare if you ever tried that one for yourself. However — it works. And hopefully I can forget about all the code I had to write pretty soon.

You can see in the screenshot that AS3V places markers in your Eclipse code. It works as an incremental project builder which means it is pretty fast since it only evaluates all your sources that have changed independently. If you have any suggestions for possible rules, please tell me. The Flex SDK coding conventions could be interesting for instance. Right now the Eclipse plug-in has still some problems but I think that a first version might be released in the next few weeks.

25 Comments

  1. Posted May 20, 2009 at 8:48 pm | Permalink

    Very smart dude ;)

    I love it!

  2. Cédric
    Posted May 20, 2009 at 8:59 pm | Permalink

    haaann… I want to try it :)

  3. s
    Posted May 20, 2009 at 9:34 pm | Permalink

    great!

  4. Pedram
    Posted May 20, 2009 at 10:54 pm | Permalink

    hmmm, it’s nice.
    i think this is very important and efficient tool.
    thanks

  5. Posted May 20, 2009 at 11:51 pm | Permalink

    Wow… looks awesome

  6. Posted May 21, 2009 at 2:44 am | Permalink

    Right on! Really looking forward to putting my code through the ringers.

  7. Posted May 21, 2009 at 3:15 am | Permalink

    It’s a great work.

  8. Posted May 21, 2009 at 4:34 am | Permalink

    Well,

    I’m looking into for a tool like this for flexmojos…

    Do you have any idea when you plan to release it?

    VELO

  9. yuku
    Posted May 21, 2009 at 6:33 am | Permalink

    Wow, that seems great! The parser and the AST it generates hopefully will encourage some people to write a better as3 compiler than Adobe’s asc.jar so that for example, if a and b are ints, b = a + 2 is not compiled as getlocal(a), push(2), add, cast to int, setlocal(b), but immediately using add_i instructions.

  10. Posted May 21, 2009 at 10:13 am | Permalink

    Absolutely amazing work!
    Question, how do you implement the rules? Is this something hard-coded or are you also thinking of letting users add their own rules through some sort of XML configuration (or any other type for that matter)?
    I realize not all rules can be defined as plain XML, but for a lot of ‘style’ rules this will be quite feasible.

    cheers and looking forward to checking out your results!

  11. Paulo Miranda
    Posted May 21, 2009 at 11:15 am | Permalink

    You can take ideias from this one (http://pmd.sourceforge.net/)
    PMD is an very advanced version for java language.

  12. Posted May 21, 2009 at 11:20 am | Permalink

    Yes, PMD is the reason why I started writing AS3V. I think we need such tools for ActionScript as well.

    Roland: The rules are currently implemented using Java code. PMD supports also XPath expressions but that is currently not implemented in AS3V. Maybe I will do that as well. Some rules like the cyclomatic complexity checks can not be done using XPath of course.

  13. Posted May 21, 2009 at 7:34 pm | Permalink

    joa: it would be pretty awesome if you’d be able to include the XPath expressions. I was thinking how AS3V could be used to check coding and syntax conventions for a particular project or team. If it could subsequently be made part of an automated build system then this would be really useful. The system could warn individual coders that they’re not following the conventions properly that are set for the current project.
    Especially in big projects with multiple developers this could prove to be very useful.
    Anyways, still looking forward to your results :)

  14. Posted May 21, 2009 at 8:09 pm | Permalink

    Yes, an ANT task is important as well. Also using AS3V as an SVN hook is a possibility. Then you could get a warning by e-mail that your code does not match the conventions.

  15. Posted May 22, 2009 at 10:53 am | Permalink

    alright, so we’re on the same page there, great! :) good luck with finishing this!

  16. Posted May 24, 2009 at 10:43 am | Permalink

    This looks amazingly useful and I’ll look forward to trying it out when you release it. One point I think you might consider, though, is how you classify Errors vs. Warnings and Infos. In the example you post, you list an overburdened constructor, clumsy math and unreachable code as errors. I submit that none of those should be classed as an error, ie, they don’t stop your code from functioning. This is important because during rapid development you might be less concerned with clean, efficient code and more with simply trying to identify where your code is breaking. (One could of course simply turn AS3V off, I suppose). As it stands, this tool might obfuscate “true” errors.

  17. Posted May 24, 2009 at 4:03 pm | Permalink

    Marc, you are absolutely right. I changed already most of the errors to warnings — although unreachable code will stay marked as an error by default.

    The best idea is to have preferences for violation levels of course. In Eclipse also per project. We will see how that works out.

  18. Posted Jun 3, 2009 at 1:51 am | Permalink

    Hello Any news, progress, can i help you, also i check in google code seem we have very old version :(.

    Also

  19. Pepigno
    Posted Jun 19, 2009 at 9:51 am | Permalink

    I want to try it , please :)

  20. Posted Jun 19, 2009 at 1:11 pm | Permalink

    Awesome!
    Will it work with FDT as well?

  21. Posted Jun 19, 2009 at 3:35 pm | Permalink

    sure, only problem is that i can not add tooltips to the markers i place for fdt .. or i could do that, but in that case the eclipse plugin would work only with eclipse.

  22. Posted Jun 19, 2009 at 7:01 pm | Permalink

    Very useful tool. I look forward to trying it out.

  23. DieTapete
    Posted Jun 20, 2009 at 3:09 pm | Permalink

    Oh this is really great! I can’t wait to download it!

  24. jasper
    Posted Jun 26, 2009 at 8:24 am | Permalink

    Looking forward to this. . . great work.

    Would really appreciate a command-line version that could be run (eg as part of a continuous integration build) outside of an IDE . . . in fact I could probably jump in and write required ant tasks if you need a hand?

  25. Posted Jun 26, 2009 at 6:45 pm | Permalink

    There you go: http://blog.joa-ebert.com/2009/06/26/as3v-for-ant-released/

3 Trackbacks

  1. By Twitted by manfred_karrer on May 31, 2009 at 2:22 pm

    [...] This post was Twitted by manfred_karrer – Real-url.org [...]

  2. By Vice Test Blog Archive » AS3V on Jun 7, 2009 at 3:06 am

    [...] is a really cool tool in the works by Joa Ebert which he is calling AS3V. In his own words… AS3V is basically a tool that can check for syntactical correctness. It [...]

  3. By Adobe MAX Euro Invasion « Influxis Labs on Sep 2, 2009 at 10:59 pm

    [...] the award winning Hobnox AudioTool. He is known for a lot of projects including WiiFlash, popforge, AS3V, ActionScript Wiki, PBDT and many [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*