[codeface] Re: Dead code in Codeface

  • From: Wolfgang Mauerer <wm@xxxxxxxxxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx, Andreas Ringlstetter <andreas.ringlstetter@xxxxxxxxxxxxxxxxxxxx>, "Joblin, Mitchell (ext)" <mitchell.joblin.ext@xxxxxxxxxxx>
  • Date: Wed, 19 Aug 2015 19:56:22 +0200

First of all, thanks for the code review!

Am 19/08/2015 um 16:01 schrieb Andreas Ringlstetter:

There appears to be some dead code in codeface/cluster/cluster.py:

if __name__ == "__main__":

That entire section is not only not used, but even references to
functions no longer existent. Does anyone intent to run cluster.py
directly any longer?

In ancient times, cluster.py was called as an external script to
perform the clustering. These days, we don't do that any more,
but call the python functions directly without detours.

Running cluster.py directly was beneficial when initially experimenting
with the clustering techniques, but I don't think we need this
any more. I'm good with the code being deleted.


def randomizeCommitCollaboration(codeBlks, fileState):
def computePersonsCollaboration(codeBlks, personId, id_mgr, maxDist):
def computeEdgeStrength(blk1, blk2, maxDist):
def simpleCluster(codeBlks, snapShotCmt, maxDist, author=False):
def findCodeBlocks(fileState, cmtList, author=False):

Not tested and not referenced anywhere else in the entire code base.

These functions are/have been used to perform research, but they are
indeed not used in vanilla Codeface. Mitchell, do you have any
snippets how to use the functions so that it's at least documented
what they are supposed to be used for?

We will need the functions once the corresponding features are
integrated into the web front-end/results are stored in the
data base, so the definitions should be kept. We might think about a
convention to mark functions that are used in "research mode", though,
so that they don't get deleted accidentally.

def testFileCommit():
def testAnalysis(link_type):

Completely defective tests cases, which are not even matching the
current API.

These were used for Mitchell's research purposes; since they also
contain absolute paths, they are obviously only useful for a user
"mitchell" on a Mac.

Mitchell, I suppose there's no use for these functions any more and
they can be deleted?


Same case of broken unit tests and deprecated main functions in various
other files. Are any of these still of any use or may they be purged?

Unit test should not be deleted, but rather be fixed. We have way too
few tests anyway.
Otherwise, it's hard to say in general and should be decided on a
case by case basis.


There also appear to be remainders of some "subsys" support spread
around the code base, but non of the corresponding code paths is covered
by any analysis nor unittest. What was that feature supposed to be? Is
it still of any use?

Resolving a system into subsystems was indeed supported in analyses
that sparked Codeface (historical evidence:
http://www.linux-kongress.org/2009/slides/open_unix_kernels_wolfgang_mauerer.pdf),
but support for subsystems is not available any more. I don't think
it makes sense to revive this, so eliminating the remaining references
would be beneficial.

Best regards, Wolfgang Mauerer


Other related posts: