2

In Python, how can I calculate LCOM (lack of cohesion) for C++ files (or any other file types) using SciTools Understand API?

For an assignment, we're asked to calculate LCOM ourselves instead of using SciTools's Understand.

To calculate LCOM4, I need the following metrics,

  1. number of functions/methods in a class (given by Understand as "CountDeclFunction")

  2. number of method pairs in class with at least one instance variable that they commonly use or define in their body.

  3. number of method pairs in class that have at least one instance method that they commonly call in their body.

Any suggestion is much appreciated.

Spiky
  • 408
  • 1
  • 4
  • 11

1 Answers1

0

From the metrics listed on https://scitools.com/support/metrics-reports/, I believe you have to develop your own metrics to complement what Understand provides.

cher
  • 51
  • 3