scitools.com

← Metric catalog

Uses is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.

Uses

API IDCountUses
TargetsObjects
LanguagesAny
CategoriesCoupling
CostQuery

The number of times this object is used

Example:

    int a_global = 0;
    void function1() {
      a_global += 1;
      if (a_global > 1)    // + 1 use reference
        a_global = 0;
    }
    void function2() {
      a_global -= 1;
      a_global -= 1;
      if (a_global < 0)    // + 1 use reference
        a_global = 0;
      if (a_global > 10)   // + 1 use reference
        a_global = 10;
    }
                           // CountUses = 3
    

Compare to CountUsesUnique which counts unique entities that use this object.