Microsoft Dynamics Ax developer's blog

Wednesday, November 19, 2014

Static code analysis using XLNT

In ax 2012 there is a code upgrade tool based on parser named XLNT - it allows to use syntax tree if X++ from .NET.

I have written a small example of static analysis for X++ based on that technology  http://1drv.ms/1u9Rs8x

It detects code patters that are likely to be copy-and-paste errors (when somebody copies code but forget to change something in a copy) like:

case X: some code
...
case X: some code

if (x) {
   y
}
else
{
   y
}