two questions

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

two questions

Stéphane Ducasse
Hi guys

I’m coding an importer for moose to import metrics computed from other tools.

Now I created would like to see the imported metrics on FAMIX class.


So I added 

FAMIXClass >> TR_LCOM
<MSEProperty: #TR_LCOM type: #Number>
<MSEComment: 'lack of cohesion in methods from XX tools'>
<derived>
^ self propertyNamed: #TR_LCOM

and in my importer 

createFamixClassFor: aCollection
"aCollection in the form Name values* following the tag pattern"

| aClass |
aClass := FAMIXClass new.
aClass name: (aCollection first replaceAll: Character space with: $_).
self tags allButFirst
withIndexDo: [ :t :i | aClass propertyNamed: 'TR_' , t put: (aCollection at: i + 1) asNumber ].
self targetModel add: aClass.
^ aClass


testExtendedFAMIX
| importer fmClass |
importer := ThreImporter on: self streamExample.
importer import.
fmClass := importer createFamixClassFor: importer importedArray second.
self assert: fmClass name = 'Messages'.
self assert: (fmClass propertyNamed: 'TR_LoC') equals: 67.
self assert: fmClass TR_LCOM equals: 67.
self halt.

Two questions:

- why I do not see the metrics in the imported famix class? Is there a cache for the metadescription.

- How do I add a Model to the UI? so that we can browse from the Moose Panel?


Tx

BTW I have to see because I do not get the email in my mailbox. 


--------------------------------------------
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: two questions

Stéphane Ducasse

On 12 Sep 2017, at 10:29, Stéphane Ducasse <[hidden email]> wrote:

Hi guys

I’m coding an importer for moose to import metrics computed from other tools.

Now I created would like to see the imported metrics on FAMIX class.


So I added 

FAMIXClass >> TR_LCOM
<MSEProperty: #TR_LCOM type: #Number>
<MSEComment: 'lack of cohesion in methods from XX tools'>
<derived>
^ self propertyNamed: #TR_LCOM

and in my importer 

createFamixClassFor: aCollection
"aCollection in the form Name values* following the tag pattern"

| aClass |
aClass := FAMIXClass new.
aClass name: (aCollection first replaceAll: Character space with: $_).
self tags allButFirst
withIndexDo: [ :t :i | aClass propertyNamed: 'TR_' , t put: (aCollection at: i + 1) asNumber ].
self targetModel add: aClass.
^ aClass


testExtendedFAMIX
| importer fmClass |
importer := ThreImporter on: self streamExample.
importer import.
fmClass := importer createFamixClassFor: importer importedArray second.
self assert: fmClass name = 'Messages'.
self assert: (fmClass propertyNamed: 'TR_LoC') equals: 67.
self assert: fmClass TR_LCOM equals: 67.
self halt.

Two questions:

- why I do not see the metrics in the imported famix class? Is there a cache for the metadescription.

MooseModel resetMeta :)


- How do I add a Model to the UI? so that we can browse from the Moose Panel?


Tx

BTW I have to see because I do not get the email in my mailbox. 


--------------------------------------------
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


--------------------------------------------
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: two questions

Pavel Krivanek-3
In reply to this post by Stéphane Ducasse
Have you tried MooseModel resetMeta?

-- Pavel

2017-09-12 10:29 GMT+02:00 Stéphane Ducasse <[hidden email]>:
Hi guys

I’m coding an importer for moose to import metrics computed from other tools.

Now I created would like to see the imported metrics on FAMIX class.


So I added 

FAMIXClass >> TR_LCOM
<MSEProperty: #TR_LCOM type: #Number>
<MSEComment: 'lack of cohesion in methods from XX tools'>
<derived>
^ self propertyNamed: #TR_LCOM

and in my importer 

createFamixClassFor: aCollection
"aCollection in the form Name values* following the tag pattern"

| aClass |
aClass := FAMIXClass new.
aClass name: (aCollection first replaceAll: Character space with: $_).
self tags allButFirst
withIndexDo: [ :t :i | aClass propertyNamed: 'TR_' , t put: (aCollection at: i + 1) asNumber ].
self targetModel add: aClass.
^ aClass


testExtendedFAMIX
| importer fmClass |
importer := ThreImporter on: self streamExample.
importer import.
fmClass := importer createFamixClassFor: importer importedArray second.
self assert: fmClass name = 'Messages'.
self assert: (fmClass propertyNamed: 'TR_LoC') equals: 67.
self assert: fmClass TR_LCOM equals: 67.
self halt.

Two questions:

- why I do not see the metrics in the imported famix class? Is there a cache for the metadescription.

- How do I add a Model to the UI? so that we can browse from the Moose Panel?


Tx

BTW I have to see because I do not get the email in my mailbox. 


--------------------------------------------
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: two questions

Pavel Krivanek-3
In reply to this post by Stéphane Ducasse
You were faster :-)

-- Pavel

2017-09-12 10:31 GMT+02:00 Stéphane Ducasse <[hidden email]>:

On 12 Sep 2017, at 10:29, Stéphane Ducasse <[hidden email]> wrote:

Hi guys

I’m coding an importer for moose to import metrics computed from other tools.

Now I created would like to see the imported metrics on FAMIX class.


So I added 

FAMIXClass >> TR_LCOM
<MSEProperty: #TR_LCOM type: #Number>
<MSEComment: 'lack of cohesion in methods from XX tools'>
<derived>
^ self propertyNamed: #TR_LCOM

and in my importer 

createFamixClassFor: aCollection
"aCollection in the form Name values* following the tag pattern"

| aClass |
aClass := FAMIXClass new.
aClass name: (aCollection first replaceAll: Character space with: $_).
self tags allButFirst
withIndexDo: [ :t :i | aClass propertyNamed: 'TR_' , t put: (aCollection at: i + 1) asNumber ].
self targetModel add: aClass.
^ aClass


testExtendedFAMIX
| importer fmClass |
importer := ThreImporter on: self streamExample.
importer import.
fmClass := importer createFamixClassFor: importer importedArray second.
self assert: fmClass name = 'Messages'.
self assert: (fmClass propertyNamed: 'TR_LoC') equals: 67.
self assert: fmClass TR_LCOM equals: 67.
self halt.

Two questions:

- why I do not see the metrics in the imported famix class? Is there a cache for the metadescription.

MooseModel resetMeta :)


- How do I add a Model to the UI? so that we can browse from the Moose Panel?


Tx

BTW I have to see because I do not get the email in my mailbox. 


--------------------------------------------
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


--------------------------------------------
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: two questions

Tudor Girba-2
In reply to this post by Stéphane Ducasse
Hi,

> On Sep 12, 2017, at 10:29 AM, Stéphane Ducasse <[hidden email]> wrote:
>
> Hi guys
>
> I’m coding an importer for moose to import metrics computed from other tools.
>
> Now I created would like to see the imported metrics on FAMIX class.
>
>
> So I added
>
> FAMIXClass >> TR_LCOM
> <MSEProperty: #TR_LCOM type: #Number>
> <MSEComment: 'lack of cohesion in methods from XX tools'>
> <derived>
> ^ self propertyNamed: #TR_LCOM
>
> and in my importer
>
> createFamixClassFor: aCollection
> "aCollection in the form Name values* following the tag pattern"
>
> | aClass |
> aClass := FAMIXClass new.
> aClass name: (aCollection first replaceAll: Character space with: $_).
> self tags allButFirst
> withIndexDo: [ :t :i | aClass propertyNamed: 'TR_' , t put: (aCollection at: i + 1) asNumber ].
> self targetModel add: aClass.
> ^ aClass
>
>
> testExtendedFAMIX
> | importer fmClass |
> importer := ThreImporter on: self streamExample.
> importer import.
> fmClass := importer createFamixClassFor: importer importedArray second.
> self assert: fmClass name = 'Messages'.
> self assert: (fmClass propertyNamed: 'TR_LoC') equals: 67.
> self assert: fmClass TR_LCOM equals: 67.
> self halt.
>
> Two questions:
>
> - why I do not see the metrics in the imported famix class? Is there a cache for the metadescription.
>
> - How do I add a Model to the UI? so that we can browse from the Moose Panel?

If you want to add it to the MooseModel root unique instance you can do:
        model install.

However, you can also directly inspect a model, and you will get pretty much the same interface.

Doru

>
> Tx
>
> BTW I have to see because I do not get the email in my mailbox.
>
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr
> http://www.synectique.eu / http://www.pharo.org 
> 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

--
www.tudorgirba.com
www.feenk.com

"If you interrupt the barber while he is cutting your hair,
you will end up with a messy haircut."

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