The form $i` creates a temporary variable whereas `$i does not. It save CPU cycles.

Non compliant Code Example

$i++

Compliant Solution

++$i

The three sources of impacts of a code identified are:

  • Energy: measured in joules (J)

  • Transfer: measured in Bytes (B)

  • Storage: measured in Bytes (B)

The control of these 3 impacts allows to lengthen the life of the terminals as well as reduce their energy consumption.

The ETSdiff tool allows measuring a differential on these three values and in a given context (database and fixed measurement environment).

The results generated by ETSdiff must help define the interest of the rule reported by SonarQube in the context of the code analyzed.

Case for a 1GB database:

ETSdiff percent comparison
Source of impacts Compliant Non-compliant

Energy (J)

1.8163645000000002

0.2613885000000001

Transfer (B)

11265758

11290494

Storage (B)

637548673

637548673