Hi!
I tried to extend the importing context with a variable computeMetricsAfterImport. However
this more complex than expected.
Some metrics cannot be computed for a famix element that does not belong to a moose model.
This is the case for example if you send #numberOfLinesOfCode to a famix method. It is
necessary to know whether the model is a Smalltalk model or not.
This means that MooseImportClassesTask cannot ask for the metrics to be computed, since
the famix elements do not belong to a model.
All in all, it seems that the easiest way to do it is to have a method
MooseModel>>computeAllMetrics. No need to extend the importing context and the
importer in that case.
Not really great in my opinion, but this is the simplest thing.
Any opinion?
Alexandre
On 22 Nov 2011, at 10:07, Alexandre Bergel wrote:
A wrong keystroke has sent the email before it was
finished.
It seems to me that :
> 1 - Putting a new variable
'computeMetricsLazily' in MooseImportingContext.
is the cleaner way. As stef said, this will have an impact on the importer, but a very
small one. The importer has to execute a similar piece of code that you suggested.
Alexandre
On 22 Nov 2011, at 10:02, Tudor Girba wrote:
> Which option?
>
> Doru
>
> On Tue, Nov 22, 2011 at 1:38 PM, Alexandre Bergel
> <alexandre.bergel(a)me.com> wrote:
>> I basically see two ways of achieving this:
>>
> 1 - Putting a new variable
'computeMetricsLazily' in MooseImportingContext.
>> 2 - Another option
is to add a method MooseModel>>computeAllMetrics
>>
>> Option seems cleaner to me.
>> Any further comment before I put my hand on the keyboard?
>>
>> Alexandre
>>
>> On 22 Nov 2011, at 04:16, Tudor Girba wrote:
>>
>>> We have done this because in most cases, we only need a couple of metrics and
thus it is not useful to spend a tone of time computing all metrics.
>>>
>>> Currently, there is nothing out of the box that would force the computation
of all metrics. However, it should not be hard to do. For example:
>>>
>>> model allClasses do: [:eachEntity |
>>> eachEntity mooseDescription allPrimitiveAttributes do: [:eachProperty |
>>> eachEntity mmGetProperty: eachProperty ] ]
>>>
>>> Doru
>>>
>>> On 21 Nov 2011, at 20:58, Alexandre Bergel wrote:
>>>
>>>> Hi!
>>>>
>>>> Metrics for smalltalk code are lazy computed. It is only when you send
#numberOfLinesOfCode to a class or a method that the value is actually computed from the
code present in the image.
>>>>
>>>> The current schema is not really optimal when loading multiple versions.
>>>> The problem we are facing is that we need to manually call the metric
methods after each version is loaded.
>>>>
>>>> Is there a way to force the metrics to be computed while importing code?
>>>>
>>>> Cheers,
>>>> Alexandre
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel
http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> Moose-dev(a)iam.unibe.ch
>>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>
>>> --
>>>
www.tudorgirba.com
>>>
>>> "Some battles are better lost than fought."
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> Moose-dev(a)iam.unibe.ch
>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel
http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev(a)iam.unibe.ch
>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>
>
>
> --
>
www.tudorgirba.com
> "Every thing has its own flow"
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.