scitools.com

← Metric catalog

Modifies 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.

Modifies

API ID: CountModifies
Languages: Any
Targets: Objects

The number of times this object is modified

Example:

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

Compare to CountModifiesUnique which counts unique entities that modify this object.