Anne spotted a bug in numberOfLinesOfCode.
In Java, one can easily find classes with numberOfLinesOfCode <
numberOfLinesOfCodewithMoreThanOnecharacter
The reason is that numberOfLinesOfCodewithMoreThanOnecharacter is
defined in SourcedEntity by counting the lines (with more than 1 char)
in the sourceText
numberOfLinesOfCode is the sum of numberOfLinesOfCode of the methods.
This is clearly not right for Java where a class as more code than just
its methods.
But it is not even coherent for Smalltalk where a class' sourceText
includes the name of the class (at least 1 additional line).
So even in Smalltalk, one finds classes with numberOfLinesOfCode <
numberOfLinesOfCodewithMoreThanOnecharacter
(happens when none of the methods of the class have blank lines e.g.
FamixEntity)
So I propose to unify both methods and compute numberOfLinesOfCode in
SourcedEntity from the sourceText
(and remove FAMIXClass>>numberOfLinesOfCode)
Second, for methods, the same numberOfLinesOfCode has a backward
compatibilty with "exporters that use LOC as a property name"
(in this case, it uses LOC instead of computing the number)
Anybody still having this case?
So I propose to remove FAMIXBehaviouralEntity>>numberOfLinesOfCode
nicolas
--
Nicolas Anquetil -- MCF (HDR)
Project-Team RMod