Number of lines is a bit tricky topic, because it can mean different things. Maybe you want to exclude comments, maybe you don’t want to count lines copied from lower layers, maybe you want to include things like form designs because they also increase complexity, maybe you want to exclude them because you are interested in code only…
The easiest way is just count lines in .xpo files, more complex scenarios would use reflection (e.g. to count selected TreeNode types only).
You can try this tool for complexity measurements, in AX2012 you can also take a look at SysStartupCmdUpdateMetrics (it seems not to be intended for public use so it’s not very user friendly - let me know if you need details about it).
Is there any way that we can count total number of lines in the whole AOT (Classes, Tables, Reports, Forms) no matter it is USR layer or any other layer.
Everything is possible, but it depends on what you want to achieve, as I mentioned before. You can, say, export all objects to one big .xpo and count its lines, if this is what you really want to count.
Everything is possible, but it depends on what exactly you want to achieve, as I mentioned before. You can, say, export all object to one big .xpo and count its lines, if this is really what you want to measure.