I want to reimplement software engineering metrics using moose chef instead of moose cook.
for example to compute cohesion I would do (among other things):
self queryAllOutgoingDependencies atClassScope withinMyPackage
i.e. :
1- from a package (self)
2- get all its "outgoingdependencies" (outgoing does not mean going outside the package, this includes dependencies within th package)
3- put that at class level (because we are interested in dependencies between classes within or outside the package)
4- and filter those that are inside self
I want the result to be all dependencies from classes within package self going to classes within package self.
but (from the moose chef documentation):
"The scope operators exclude self loops by default (this
was also the default in Moose Cook). That is, the query result will not
contain the receiver scope itself: you will not get something like
PackageX -> PackageX in the result (the reason for this is that in
general algorithms do not like graphs with self loops)."
So:
- should we change that default?
- should I change my query?
I believe if there is a method to exclude self loops (withoutSelfLoop), it should not be done automatically in some case let those who want it do it themselves.
What say you?
nicolas