On Mon, Sep 29, 2014 at 1:46 PM, Cường Phạm cuongpham92@gmail.com wrote:
Dear Mr Serge Stinckwich,
It is me again, sorry for disturbing. I have asked Mai Anh and Fabrice about this issue, but unfortunately they do not work in this specific topic. May I ask you about the way I export CK+OO metrics from MOOSE?
As you suggested, I use MOOSE 5.0 and successfully imported mse file into MOOSE. Now I do see these metrics in section "Properties" of tab "All modelclasses", but I could not find any button to export this to some kind of document such as xml or html file. Do I have to write any code to extract them out?
There is no generic way to dump all the information of a model. MOOSE is a platform to analyse and visualize your model depending of what you want to do. Normally people who want to analyze some properties of their system, write a specific script in Pharo in order to visit their model in an appropriate way.
For example, if you want to generate a collection with the number of methods (WMC metrics) for each classes of your model, you can do:
self allClasses collect: [:eachClass | eachClass numberOfMethods].
If you want to generate a result html file, you can do the following:
FileLocator desktop / 'result.html' writeStreamDo: [:out| out << '<html><head><title>Results</title></head><body><table border=1>'. out << '<tr bgcolor=silver>'; << '<th>Class</th><th>number of methods</th></tr>'. self allClasses collect: [ :eachClass| out << '<tr>'; << '<th>'; << eachClass asString; << '</th>'; << '<th>' ; << eachClass numberOfMethods; << '</th>' ; << '</tr>' ]. out << '</table></body></html>'. ]
For exemple, with a model with all the Collection classes, I will obtain the attached html table. After that you need to adapt the html dump to your needs.
Regards,