Held or removed rules

The implementation of the following rules has been held, deprecated or removed due to various issues, detailed in further details below.

Rules to be reworked / measured / clarified

This table lists rules proposed by the community, but they have to be reworked / measured / clarified before being implemented in ecoCode plugins. (Issues and PR are closed, but they can be reopened once rework is launched.)

Rule key Language Name Description Invalidation

CRJVM204

Java

Detect unoptimized file formats

We have to clarify and rework this rule for Java before accepting the implementation

Github discussion - issue
Github discussion - PR

EC22

Java

The use of methods for basic operations

We have to measure this rule for Java before accepting the implementation

Github discussion - issue
Github discussion - PR

EC22

PHP

The use of methods for basic operations

We have to measure this rule for PHP before accepting the implementation

Github discussion - issue

EC53

Java

Using arrays in foreach loops

No good arguments and not enough green measures.

Github discussion with sources

GRSP0007

PHP

Prefer using foreach

We have to clarify and measure this rule for PHP before accepting the implementation

Github discussion - PR

GRSP0008

PHP

Avoid using relative path

We have to clarify and measure this rule for PHP before accepting the implementation

Github discussion - PR

Java

Avoid returning a JPA Entity in a RestController

We have to clarify and measure this rule for Java before accepting the implementation

Github discussion - issue
Github discussion - PR

Deprecated rules

This table lists rules proposed by the community but deprecated in ecoCode plugins with the justification. These rules will be completely deleted in next releases and moved to bottom deleted rules array.

Rule key Language Name Description Invalidation

EC34

Java / Python / PHP

Using try…​catch…​finally calls

Implementation is too simple (only detection of presence of "try" statement) AND replaced by EC35 rule

Github discussion with measures: general/Java / Python / PHP

EC69

Python

Calling a loop invariant function in a loop condition

Finally, not applicable for Python

Github discussion with sources

Refused / deleted rules

This table lists rules proposed by the community but refused or/and deleted in ecoCode plugins with the justification.

Rule key Language Name Description Invalidation

CRDOM203

HTML

HTML page must contain a doctype tag

The difference in performance is negligible, this rule is more related to the user experience.

Github discussion with sources

CRPYT

Python

Use numpy array instead of standard list

The use of numpy library to perform array manipulation is more energy efficient than the use of the standard list functions.

Github discussion with measures

EC4

Java

Avoid using global variables

Global variables do not exist in Java.

Github discussion with sources

EC8

JavaScript

Avoid using high accuracy geolocation

The rule has been merged with the rule EC523

Github discussion with sources

EC63

Java

Unnecessarily assigning values to variables

There are already 3 native SonarQube rules for Java.

Github discussion with sources

EC66

Python

Use single quote (') instead of quotation mark (")

Finally, not applicable for Python

Github discussion with sources

EC75

Java

Don’t concatenate strings in loops

Optimizations on Java concatenation Strings are useless since JDK8

Github discussion with sources