I'm taking the lines of code for my Java project , the project contains lot of XML files too. Now my question is when calculating lines of code. Do i need to consider XML lines of code as well? Please help
+10
A:
IMO counting lines of code is a terrible quality metric. I consider it a great day when I remove hundreds of lines of code.
However answering your question. if your XML is handwritten and represents metadata that configures your application then yes I'd consider it to be code.
blissapp
2010-05-17 06:18:53
+1 for both paragraphs!
Dean Harding
2010-05-17 06:20:06
Since you consider lowering the LOC count a great thing, why then would counting LOC be a terrible quality metric? If used in isolation it would be a poor metric I agree...but the OP hasn't stated how he is intending to use the number only that he wants to collect it... there are plenty of metrics that rely on LOC count as one of their inputs (like say cyclomatic complexity)...
mezoid
2010-05-17 06:30:42
I'm suppose I'm really responding as a metric of Programmer Productivity rather than quality. I agree that the act of counting the number of lines itself is not necessarily an indicator of a bad quality measure. That's why I made a point of also answering the question.
blissapp
2010-05-17 06:43:47
+1
A:
It depends if the xml is representing data or if it is a DSL of some sort.
If it is just data then I'd ignore it from a LOC metric. However, if it is something like a NAnt script which is essentially programming in xml then I would be tempted to count it as LOC.
mezoid
2010-05-17 06:19:57