About numberofLines of code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

About numberofLines of code

Stéphane Ducasse
Hi 

It seems totalNumberOfLinesOfCode disappeared from FamixTypeGroup recently. 

Now I wonder if the new implementation is correct because it would be nice to take into account class definition size.

MooseAbstractGroup >> numberOfLinesOfCode
<MSEProperty: #numberOfLinesOfCode type: #Number>
<MSEComment: 'The number of classes in the model'>
^ self
lookUpPropertyNamed: #numberOfLinesOfCode
computedAs: [ self allMethods sum: #numberOfLinesOfCode ]

What do you think?

Stef

--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Julie Jonas 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: About numberofLines of code

Vincent BLONDEAU

 

 

From: Moose-dev [mailto:[hidden email]] On Behalf Of Stéphane Ducasse
Sent: vendredi 29 septembre 2017 13:22
To: Moose-related development
Subject: [Moose-dev] About numberofLines of code

 

Hi 

 

Hi,

 

It seems totalNumberOfLinesOfCode disappeared from FamixTypeGroup recently. 

 

Indeed. I removed it because it was a duplication of numberOfLinesOfCode.

 

Now I wonder if the new implementation is correct because it would be nice to take into account class definition size.

 

MooseAbstractGroup >> numberOfLinesOfCode

            <MSEProperty: #numberOfLinesOfCode type: #Number>

            <MSEComment: 'The number of classes in the model'>

            ^ self

                        lookUpPropertyNamed: #numberOfLinesOfCode

                        computedAs: [ self allMethods sum: #numberOfLinesOfCode ]

 

What do you think?

 

That it is only for Smalltalk because with do not have this problem in Java. I do not even think that in Smalltalk the class definition is represented in the moose model by an entity.

I have no time to check it now.

 

If you want to specialize it, it should be language dependent.

 

Cheers,

Vincent

 

 

Stef

 

--------------------------------------------

Stéphane Ducasse

03 59 35 87 52

Assistant: Julie Jonas 

FAX 03 59 57 78 50

TEL 03 59 35 86 16

S. Ducasse - Inria

40, avenue Halley, 

Parc Scientifique de la Haute Borne, Bât.A, Park Plaza

Villeneuve d'Ascq 59650

France

 


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: About numberofLines of code

Anne Etien

Le 1 oct. 2017 à 01:25, Vincent BLONDEAU <[hidden email]> a écrit :

 
 
From: Moose-dev [[hidden email]] On Behalf Of Stéphane Ducasse
Sent: vendredi 29 septembre 2017 13:22
To: Moose-related development
Subject: [Moose-dev] About numberofLines of code
 
Hi 
 
Hi,
 
It seems totalNumberOfLinesOfCode disappeared from FamixTypeGroup recently. 
 
Indeed. I removed it because it was a duplication of numberOfLinesOfCode.
 
Now I wonder if the new implementation is correct because it would be nice to take into account class definition size.
 
MooseAbstractGroup >> numberOfLinesOfCode
            <MSEProperty: #numberOfLinesOfCode type: #Number>
            <MSEComment: 'The number of classes in the model'>
            ^ self
                        lookUpPropertyNamed: #numberOfLinesOfCode
                        computedAs: [ self allMethods sum: #numberOfLinesOfCode ]
 
What do you think?
 
That it is only for Smalltalk because with do not have this problem in Java. I do not even think that in Smalltalk the class definition is represented in the moose model by an entity.
I have no time to check it now.

It is wrong.
In Java, the number of lines of code of a class DOES NOT EQUAL to the sum of the number of lines of code of its methods. You have all the class definition part with the imports, the variable instance definitions and so on.
Stephane’s remark does not mean that the old definition was correct. In any case, the new one is wrong.

Cheers,

Anne

 
If you want to specialize it, it should be language dependent.
 
Cheers,
Vincent
 
 
Stef
 
--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Julie Jonas 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
 
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: About numberofLines of code

Vincent BLONDEAU

 

 

From: Moose-dev [mailto:[hidden email]] On Behalf Of Anne Etien
Sent: dimanche 1 octobre 2017 10:36
To: Moose-related development
Subject: [Moose-dev] Re: About numberofLines of code

 

 

Le 1 oct. 2017 à 01:25, Vincent BLONDEAU <[hidden email]> a écrit :

 

 

From: Moose-dev [[hidden email]] On Behalf Of Stéphane Ducasse
Sent: vendredi 29 septembre 2017 13:22
To: Moose-related development
Subject: [Moose-dev] About numberofLines of code

 

 

Now I wonder if the new implementation is correct because it would be nice to take into account class definition size.

 

MooseAbstractGroup >> numberOfLinesOfCode

            <MSEProperty: #numberOfLinesOfCode type: #Number>

            <MSEComment: 'The number of classes in the model'>

            ^ self

                        lookUpPropertyNamed: #numberOfLinesOfCode

                        computedAs: [ self allMethods sum: #numberOfLinesOfCode ]

 

What do you think?

 

That it is only for Smalltalk because with do not have this problem in Java. I do not even think that in Smalltalk the class definition is represented in the moose model by an entity.

I have no time to check it now.

 

It is wrong.

In Java, the number of lines of code of a class DOES NOT EQUAL to the sum of the number of lines of code of its methods. You have all the class definition part with the imports, the variable instance definitions and so on.

Stephane’s remark does not mean that the old definition was correct. In any case, the new one is wrong.

 

Ok, you are right.

In Java IVs initialization are already represented inside a method so only the imports are missing, but the imports are not even in the model, this kind of data have to be integrated in the parsing if you what the right value.

 

Cheers,

Vincent

 

Cheers,

 

Anne



 

If you want to specialize it, it should be language dependent.

 

Cheers,

Vincent

 

 

Stef

 

--------------------------------------------

Stéphane Ducasse

03 59 35 87 52

Assistant: Julie Jonas 

FAX 03 59 57 78 50

TEL 03 59 35 86 16

S. Ducasse - Inria

40, avenue Halley, 

Parc Scientifique de la Haute Borne, Bât.A, Park Plaza

Villeneuve d'Ascq 59650

France

 

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

 


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev