[Pharo-dev] [Bug] In ClassDescription>>#linesOfCode

Marcus Denker marcus.denker at inria.fr
Fri Nov 15 08:30:12 EST 2013

On 15 Nov 2013, at 14:18, Marcus Denker <marcus.denker at inria.fr> wrote:

> On 15 Nov 2013, at 14:07, Roberto Minelli <roberto.minelli at usi.ch> wrote:
>> Hi,
>> I looked at the implementation of #linesOfCode of ClassDescription. It is actually wrong, a correct version should be:
>> linesOfCode 
>> 	"An approximate measure of lines of code. Includes comments, but excludes blank lines."
>> 	| lines |
>> 	lines := self localMethods inject: 0 into: [:sum :each | sum + each linesOfCode]. 
>> 	^ self isMeta not
>> 		ifTrue: [lines]
>> 		ifFalse: [lines + self class linesOfCode]
> indeed!
Hmm… not that sure after thinking about it.

On the meta side, we just take the linesOfCode of all methods. On the instance side, we take the linesOfCode of all method *and* the
ones of the meta.

When you call 

Object linesOfCode

this means it takes

linesOfCode of Instance Side + linesOfCode of class side of Object

which seems ok.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131115/54d9b3ff/attachment-0002.html>

More information about the Pharo-dev mailing list