You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| GCI32 | Initialize builder/buffer with the appropriate size | If you know in advance how many characters would be appended, initialize builder/buffer with the appropriate size. They will thus never have to be resized. This saves CPU cycles and therefore consumes less energy. || ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
48
48
| GCI35 | Using try...catch calls (on File Not Found error) | When an exception is thrown, a variable (the exception itself) is created in the catch block and destroyed at the end of the block. Creating this variable and destroying it consumes CPU cycles and RAM unnecessarily. That is why it is important not to use this construction and to prefer, as much as possible, a logical test. This new rule replace old GCI34 only for a particular use case (FileNotFoundException) |[cnumr best practices (3rd edition) BP_047 (no longer exists in edition 4)](https://www.greenit.fr/2019/05/07/ecoconception-web-les-115-bonnes-pratiques-3eme-edition/)| 🚫 | ✅ | 🚀 | ✅ | 🚀 | 🚫 | 🚫 |
49
-
| GCI36 | Avoid autoplay for videos and audio content | Autoplaying media consumes unnecessary energy, especially when users might not be actively engaging with the content. |[cnumr best practices BP_4003](https://github.com/cnumr/best-practices/blob/main/chapters/BP_4003_en.md)| 🚫 | 🚫 |🚀| 🚫 | 🚫 | 🚫 | 🚧 |
49
+
| GCI36 | Avoid autoplay for videos and audio content | Autoplaying media consumes unnecessary energy, especially when users might not be actively engaging with the content. |[cnumr best practices BP_4003](https://github.com/cnumr/best-practices/blob/main/chapters/BP_4003_en.md)| 🚫 | 🚫 |✅| 🚫 | 🚫 | 🚫 | 🚧 |
50
50
| GCI66 | Use single quote (') instead of quotation mark (") | The shape using the quotation marks allows the developer to insert variables that will be substituted at run time. But if the string does not have a variable, use quotes instead. Thus, language will not look for variables to subtituture, which will reduce the consumption of CPU cycles. |[cnumr best practices (3rd edition) BP_066 (no longer exists in edition 4)](https://www.greenit.fr/2019/05/07/ecoconception-web-les-115-bonnes-pratiques-3eme-edition/)| 🚀 | ✅ | 🚀 | 🚫 | 🚀 | 🚫 | 🚫 |
51
51
| GCI67 | Use the $i++ variable during an iteration | The $i++ form has the disadvantage of generating a tem-porary variable during incrementation, which is not the case with the ++$i form. |[cnumr best practices (3rd edition) BP_067 (no longer exists in edition 4)](https://www.greenit.fr/2019/05/07/ecoconception-web-les-115-bonnes-pratiques-3eme-edition/)| ✅ | ✅ | 🚀 | 🚫 | 🚫 | 🚫 | 🚫 |
52
52
| GCI69 | Calling a loop invariant function in a loop condition | Avoid calling loop invariant functions in loop conditions. |[cnumr best practices (3rd edition) BP_069 (no longer exists in edition 4)](https://www.greenit.fr/2019/05/07/ecoconception-web-les-115-bonnes-pratiques-3eme-edition/)| ✅ | ✅ | 🚀 | 🚫 | 🚀 | ✅ | 🚫 |
@@ -73,6 +73,9 @@ Some are applicable for different technologies.
73
73
| GCI94 | Use orElseGet instead of orElse | Parameter of orElse() is evaluated, even when having a non-empty Optional. Supplier method of orElseGet passed as an argument is only executed when an Optional value isn’t present. Therefore, using orElseGet() will save computing time. |[Optimized use of Java Optional Else](https://github.com/green-code-initiative/creedengo-challenge/issues/77)| ✅ | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
74
74
| GCI203 | Detect unoptimized file formats | When it is possible, to use svg format image over other image format || 🚧 | 🚀 | 🚀 | ✅ | 🚀 | 🚀 | 🚫 |
75
75
| GCI404 | Avoid list comprehension in iterations | Use generator comprehension instead of list comprehension in for loop declaration || 🚫 | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 |
76
+
| GCI522 | Sobriety: Brightness Override | To avoid draining the battery, iOS and Android devices adapt the brightness of the screen depending on the environment light. || 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | 🚫 |
77
+
| GCI523 | Sobriety: Thrifty Geolocation (minTime) | High-precision geolocation typically requires more power from the device's GPS hardware. || 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | 🚫 |
78
+
| GCI530 | Sobriety: Torch Free | Turning on the torch mode programmatically must absolutely be avoided because the flashlight is one of the most energy-intensive component. || 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | 🚫 |
76
79
|| Use official social media sharing buttons | These JavaScript plugins are very resource-intensive: to work, they require a large number of requests and download heavy files. It is better to prefer direct links. |[cnumr best practices (3rd edition) BP_019](https://github.com/cnumr/best-practices/blob/main/chapters/BP_019_fr.md)| 🚫 | 🚫 | 🚀 | 🚫 | 🚫 | 🚫 | 🚀 |
77
80
|| Non-grouped similar CSS declarations | When multiple Document Object Model (DOM) elements have common CSS properties, declare them together in the same style sheet. This method reduces the weight of CSS. |[cnumr best practices (3rd edition) BP_025](https://github.com/cnumr/best-practices/blob/main/chapters/BP_025_fr.md)| 🚫 | 🚫 | 🚧 | 🚫 | 🚫 | 🚫 | 🚫 |
78
81
|| Non-standard fonts used | Prefer standard fonts, as they are already present on the user's computer, so they do not need to download them. This saves bandwidth, while speeding up the display of the site. |[cnumr best practices (3rd edition) BP_029](https://github.com/cnumr/best-practices/blob/main/chapters/BP_029_fr.md)| 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
0 commit comments