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.




Very smart dude ;)
I love it!
haaann… I want to try it :)
great!
hmmm, it’s nice.
i think this is very important and efficient tool.
thanks
Wow… looks awesome
Right on! Really looking forward to putting my code through the ringers.
It’s a great work.
Well,
I’m looking into for a tool like this for flexmojos…
Do you have any idea when you plan to release it?
VELO
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.
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!
You can take ideias from this one (http://pmd.sourceforge.net/)
PMD is an very advanced version for java language.
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.
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 :)
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.
alright, so we’re on the same page there, great! :) good luck with finishing this!
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.
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.
Hello Any news, progress, can i help you, also i check in google code seem we have very old version :(.
Also
I want to try it , please :)
Awesome!
Will it work with FDT as well?
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.
Very useful tool. I look forward to trying it out.
Oh this is really great! I can’t wait to download it!
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?
There you go: http://blog.joa-ebert.com/2009/06/26/as3v-for-ant-released/