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.