Rules
May 20, 2026 Β· View on GitHub
Rules support matrix by techno
This matrix lists all the rules identified as implementable within the standard creedengo plugin.
Some are applicable for different technologies.
- β Rule included in current version of creedengo
- π§ Rule implementation in progress
- π Rule to implement
- β Rule to analyze for applicability
- π« Non applicable rule
| Rule key | Name | Description | Reference/Validation | Java | Php | JS | Python | Rust | C# | HTML | Mobile Android | Mobile iOS | Source reference |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CRJVM205 | Force usage of FetchType LAZY for collections on JPA entities | π§ | β | β | β | β | β | π« | π« | π« | |||
| CRJVM206 | Avoid N+1 selects problem | π§ | β | β | β | β | β | π« | π« | π« | |||
| CRJVM207 | Customer data must have end-of-life information | π§ | β | β | β | β | β | β | π« | π« | |||
| CRJVM??? | Persistence Java : Avoid Joints on non indexed columns | π§ | β | β | β | β | β | π« | π« | π« | |||
| GCI1 | Calling a Spring repository inside a loop or a stream | The use of Spring repository in a loop or a stream induces unnecessary calculations by the CPU and therefore superfluous energy consumption. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| GCI2 | Multiple if-else statements | Using too many conditional if-else statements will impact performance since JVM will have to compare the conditions. Prefer using a switch statement instead of multiple if-else if possible, or refactor your code to reduce conditonnal statements on the same variable. Switch statement has a performance advantage over if β else. | β | β | π | β | π | π | π« | π« | π« | documentation | |
| GCI3 | Getting the size of the collection in the loop | When iterating over any collection, fetch the size of the collection in advance to avoid fetching it on each iteration, this saves CPU cycles, and therefore consumes less power. | β | β | π | π« | π | π« | π« | π« | π« | documentation | |
| GCI4 | Use global variables | When using a global variable, the interpretation engine must check: 1) that it exists in the current scope, in the one above, etc. ; 2) the variable has a value; 3) ... To avoid all these checks, it is often possible to pass the useful variables as arguments of routines, making them local. This process saves computational time (CPU cycles). | cnumr best practices (3rd edition) BP_050 (no longer exists in edition 4) | π« | β | π | β | π | π« | π« | π« | π« | documentation |
| GCI5 | Usage of preparedStatement instead of Statement | SQL will only commit the query once, whereas if you used only one statement, it would commit the query every time and thus induce unnecessary calculations by the CPU and therefore superfluous energy consumption. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| GCI7 | Rewrite native getter/setters | Overloading them lengthens the compilation and execution times of these methods, which are usually much better optimized by the language than by the developer. | cnumr best practices (3rd edition) BP_062 (no longer exists in edition 4) | π« | π« | π | β | π | π« | π« | π« | π« | documentation |
| GCI9 | Importing everything from library should be avoided | ESLint key : @creedengo/no-import-all-from-library /// type : Common | β | β | β | β | β | β | π« | π« | π« | documentation | |
| GCI10 | Use unoptimized vector images | Less heavy SVG images using less bandwidth | cnumr best practices (3rd edition) BP_036 | π | π | π | β | π | π« | β | π« | π« | documentation |
| GCI11 | Multiple access of same DOM element should be limited | ESLint key : @creedengo/no-multiple-access-dom-element /// type : Front-end | π« | β | β | π« | π« | β | π« | π« | π« | documentation | |
| GCI12 | Multiple style changes should be batched | ESLint key : @creedengo/no-multiple-style-changes /// type : Front-end | π« | β | β | π« | π« | β | π« | π« | π« | documentation | |
| GCI13 | API collections should be preferred with pagination | ESLint key : @creedengo/prefer-collections-with-pagination /// type : Back-end | β | β | β | β | β | β | π« | π« | π« | documentation | |
| GCI22 | The use of methods for basic operations | Using methods for basic operations consumes additional system resources. The interpreter must in effect and solve the objects and then the methods, just to carry out these simple operations of the language. | cnumr best practices (3rd edition) BP_048 (no longer exists in edition 4) | π« | π« | π | π | π | π« | π« | π« | π« | documentation |
| GCI24 | Returned SQL results should be limited | ESLint key : @creedengo/limit-db-query-results /// type : Back-end | π§ | π | β | β | π | π | π« | π« | π« | documentation | |
| GCI25 | Images should not have an empty source attribute | ESLint key : @creedengo/no-empty-image-src-attribute /// type : Front-end | β | β | β | β | β | β | π | π« | π« | documentation | |
| GCI26 | Shorthand CSS notations should be used to reduce stylesheets size | ESLint key : @creedengo/prefer-shorthand-css-notations /// type : Front-end | β | β | β | β | β | β | π« | π« | π« | documentation | |
| GCI27 | Usage of system.arraycopy to copy arrays | Programs spend most of the time in loops. These can be resource consuming, especially when they integrate heavy processing (IO access). Moreover, the size of the data and processing inside the loops will not allow full use of hardware mechanisms such as the cache or compiler optimization mechanisms. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| GCI28 | Optimize read file exceptions | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | ||
| GCI29 | CSS animations should be avoided | ESLint key : @creedengo/avoid-css-animations /// type : Front-end | β | β | β | β | β | β | π« | π« | π« | documentation | |
| GCI30 | Print stylesheet should be provided | ESLint key : @creedengo/provide-print-css /// type : Front-end | β | β | β | β | β | β | π« | π« | π« | documentation | |
| GCI31 | Lighter formats should be used for image files | ESLint key : ... /// type : ... | π§ | β | β | β | β | β | π | π« | π« | documentation | |
| 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. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| 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) | π« | β | π | β | π | π« | π« | π« | π« | documentation |
| GCI36 | Autoplay should be avoided for video and audio content | Autoplaying media consumes unnecessary energy, especially when users might not be actively engaging with the content. | cnumr best practices BP_4003 | π« | π« | β | π« | π« | π« | π§ | π« | π« | documentation |
| 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) | π« | π« | π« | π« | π | π« | π« | π« | π« | documentation |
| GCI67 | Use the $i++ variable during an iteration | The i form. | cnumr best practices (3rd edition) BP_067 (no longer exists in edition 4) | β | β | π | π« | π« | π« | π« | π« | π« | documentation |
| 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) | β | β | π | π« | π | β | π« | π« | π« | documentation |
| GCI72 | Perform an SQL query inside a loop | Servers are optimized to process multiple selections, insertions, or changes in a single query or transaction. consume CPU cycles, RAM, and bandwidth unnecessarily. | cnumr best practices (3rd edition) BP_072 | β | β | π | β | π | β | π« | π« | π« | documentation |
| GCI74 | Write SELECT * FROM | The database server must resolve the fields based on the schema. If you are familiar with the diagram, it is strongly recommended to name the fields. | cnumr best practices (3rd edition) BP_074 (no longer exists in edition 4) | β | β | π | β | π | π | π« | π« | π« | documentation |
| GCI75 | Don't concatenate strings in loops | Avoid repeated string allocations and consider using a StringBuilder instead. | π« | β | β | β | β | β | π« | π« | π« | documentation | |
| GCI76 | Usage of static collections | Avoid usage of static collections. If you want to use static collections make them final and create for example a singleton if needed containing the collections. The static fields are more complicated for the Garbage Collector to manage and can lead to memory leaks. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| GCI77 | Usage Pattern.compile() in a non-static context | Avoid using Pattern.compile() in a non-static context. This operation requires a non negligible amount of computational power, Using a single match saves CPU cycles and RAM consumption. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| GCI78 | Const parameter in batch update | Don't set const parameter in batch update => Put its in query. Creating this parameter and destroying it consumes CPU cycles and RAM unnecessarily. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| GCI79 | Free resources | try-with-resources Statement needs to be implemented for any object that implements the AutoCloseable interface, it save computer resources. | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation | |
| GCI81 | Specify struct layouts | When possible, specify struct layouts to optimize their memory footprint | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI82 | Make variable constant | A variable is never reassigned and can be made constant | β | π | π | π | π | β | π« | π« | π« | documentation | |
| GCI83 | Replace Enum ToString() with nameof | When no string format is applied, use nameof instead of ToString() for performance | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI84 | Avoid async void methods | Use async Task methods instead, for performance, stability and testability | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI85 | Make type sealed | Seal types that don't need inheritance for performance reasons | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI86 | GC.Collect should not be called | In most cases, the cost of calling GC.Collect far outweighs the benefits | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI87 | Use collection indexer | Collection indexers should be used instead of Linq, when available | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI88 | Dispose resource asynchronously | Resources that implement IAsyncDisposable should be disposed asynchronously | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI89 | Avoid using function cache without limit | If a function has decorators without max size cache, the program will store unlimited data | β | β | β | β | β | β | β | π« | π« | documentation | |
| GCI90 | Use Cast instead of Select to cast | Cast is optimized for this scenario and should be used | β | β | β | β | β | β | β | π« | π« | documentation | |
| GCI91 | Use filter feature before sort elements | Filter elements before sorting them for improved efficiency | π§ | β | β | β | β | β | β | π« | π« | documentation | |
| GCI92 | Use string.Length instead of comparison with empty string | Comparing a string to an empty string is unnecessary and can be replaced by a call to string.Length which is more performant and more readable. | π« | π« | π« | π« | π« | β | π« | π« | π« | documentation | |
| GCI93 | Return Task directly | Consider returning a Task directly instead of a single await | β | β | β | β | β | β | β | π« | π« | documentation | |
| 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 | β | π« | π« | π« | π« | π« | π« | π« | π« | documentation |
| GCI95 | Avoid querying SQL columns that are not used | When a database is queried without an ORM, every column that is queried should be used afterward somewhere in the function. | cnumr best practices (3rd edition) BP_075 | π§ | β | β | β | β | β | β | π« | π« | documentation |
| GCI96 | Data / AI : Pandas - Avoid Reading Unnecessary Columns in CSV Files | Reading CSV files without explicitly specifying which columns to load leads to unnecessary data loading and increases memory and energy consumption. | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI97 | Optimize square computation (scalar vs vectorized method) | In Python, if you want to square x, you can do x*x or x**2. | β | β | β | β | β | β | β | π« | π« | documentation | |
| GCI98 | Avoid raising Runtime Exceptions when a check is possible | You should not catch RuntimeException. They produce large objects and represent a problem in the program that should be fixed, not handled. | Unchecked Exceptions The Controversy (9.3. Les classes Exception, RunTimeException et Error)[https://www.jmdoudoux.fr/java/dej/chap-exceptions.htm#exceptions-3] | π§ | π« | π« | π« | π« | π« | π« | π« | π« | documentation |
| GCI99 | Data : Avoid CSV Format | The Parquet format is faster to write to, lighter in weight and faster to read data from. It is suitable for use cases where there would be a lot of data I/O, especially with Cloud storage. | π | π | π | β | π | π | π | π« | π« | documentation | |
| GCI100 | AI : Wrap PyTorch Inference in torch.no_grad() | Using a PyTorch model in evaluation mode without wrapping inference in torch.no_grad() leads to unnecessary gradient tracking | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI101 | AI : Avoid Bias in Conv Layers Before Batch Norm | Disable bias in convolutional layers when it's followed by a batch norm layer | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI102 | AI : Use pinned memory on DataLoader when using GPU | This rule applies to PyTorch data loading, where the use of pinned memory can significantly optimize data transfer between CPU and GPU. | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI103 | Don't use .items() to iterate over a dictionary when only keys or values are needed | Avoid using .items() if you only use the key or the value, as this creates an unnecessary tuple, leading to increased memory allocation and slower execution. | β | β | β | β | β | β | β | π« | π« | documentation | |
| GCI104 | Data / AI : PyTorch - Create tensors directly from Torch | In PyTorch, prefer creating tensors directly using torch.rand, torch.tensor, or other Torch methods instead of converting from NumPy arrays. Avoid using torch.tensor(np.random.rand(...)) or similar patterns when the same result can be achieved directly with PyTorch. | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI105 | Python String Concatenation | Python String Concatenation - Use Join Instead or f-Strings instead of += | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI106 | Avoid Square Root Operations In Loop | Using scalar math.sqrt (or numpy.sqrt on individual values) inside loops leads to inefficient code | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI107 | Data : Avoid Iterative Matrix Operations | Use vectorization by the usage of the built-in functions of TensorFlow, NumPy or Pandas | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI108 | Prefer Append Left | When you want to insert an element at the beginning of a list, it's better to use a deques or a double linkedlist. | β | β | β | β | β | β | β | π« | π« | documentation | |
| GCI109 | Avoid Using Exceptions for Control Flow | Using exceptions for control flow (loops, defaults, branching) is expensive in Python. Prefer idiomatic alternatives like dict.get(), enumerate(), getattr() with defaults, or proper iteration patterns. | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI110 | Python: Avoid wildcard imports (from module import *) | Wildcard imports bind many names and run module topβlevel init, slightly increasing import time and memory. Prefer explicit named imports | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI111 | Logging format interpolation | When logging with formatted string, prefer using %s with kwargs, which will be deferred until it cannot be avoided, instead of immediate formatter .format() or f"". | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI112 | Reduce memory footprint of dataclasses | Using slots can be an effective way to optimize memory usage in Python classes and improve the performance of memory-intensive applications. It is a minor remediation cost to add slots in class definitions and can have significant benefits in terms of memory efficiency. | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI113 | Prefer XGBoost to RandomForest | Using XGBoost offers a more optimized and eco-friendly alternative with competitive accuracy than RandomForest. | π« | π« | π« | π | π« | π« | π« | π« | π« | documentation | |
| GCI203 | Detect unoptimized file formats | When it is possible, to use svg format image over other image format | π§ | π | π | β | π | π | π« | π« | π« | documentation | |
| GCI404 | Avoid list comprehension in iterations | Use generator comprehension instead of list comprehension in for loop declaration | π« | π« | π« | β | π« | π« | π« | π« | π« | documentation | |
| GCI500 | Batch: Sensor Coalesce | Use maxReportLatencyUs to batch sensor events and reduce CPU wake-ups. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI501 | Batch: Job Coalesce | Use JobScheduler to batch network operations and reduce radio wake-ups. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI502 | Bottleneck: Internet In The Loop | Avoid network calls inside loops to reduce radio usage. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI503 | Bottleneck: Wifi Multicast Lock | Release Wifi multicast locks to allow the radio to sleep. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI504 | Bottleneck: Uncompressed Data Transmission | Compress data before transmission to save bandwidth and energy. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI505 | Idleness: Keep Screen On (addFlags) | Avoid keeping the screen on via addFlags to save battery. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI506 | Idleness: Keep Screen On (setFlags) | Avoid keeping the screen on via setFlags to save battery. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI507 | Idleness: Keep Cpu On | Avoid keeping the CPU on with PARTIAL_WAKE_LOCK. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI508 | Idleness: Durable Wake Lock | Release wake locks promptly to allow the device to sleep. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI509 | Idleness: Rigid Alarm | Use inexact alarms to allow the system to batch wake-ups. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI510 | Idleness: Continuous Rendering | Avoid RENDERMODE_CONTINUOUSLY for OpenGL surfaces. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI511 | Idleness: Keep Voice Awake | Release voice recognition resources when not needed. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI512 | Leakage: Camera Leak | Release camera resources when no longer needed. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI513 | Leakage: Location Leak | Stop location updates when no longer needed. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI514 | Leakage: SensorManager Leak | Unregister sensor listeners when no longer needed. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI515 | Leakage: Media Leak (MediaRecorder) | Release MediaRecorder when no longer needed. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI516 | Leakage: Media Leak (MediaPlayer) | Release MediaPlayer when no longer needed. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI517 | Optimized API: Fused Location | Use FusedLocationProviderClient instead of raw GPS. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI518 | Optimized API: Bluetooth Low-Energy | Use BLE APIs instead of classic Bluetooth. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI519 | Power: Charge Awareness | Monitor battery level and adapt behavior accordingly. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI520 | Power: Save Mode Awareness | Detect power save mode and reduce activity. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI521 | Sobriety: Thrifty Motion Sensor | Use appropriate sensor delay for motion sensors. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI522 | Sobriety: Brightness Override | To avoid draining the battery, iOS and Android devices adapt the brightness of the screen depending on the environment light. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI523 | Sobriety: Thrifty Geolocation (minTime) | High-precision geolocation typically requires more power from the device's GPS hardware. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI524 | Sobriety: Thrifty Geolocation Criteria | Use appropriate accuracy criteria for geolocation. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI525 | Sobriety: Thrifty BLE (setAdvertiseMode) | Use low-power BLE advertising mode. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI526 | Sobriety: Thrifty BLE (requestConnectionPriority) | Use balanced BLE connection priority. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI527 | Sobriety: Thrifty Geolocation (minDistance) | Set minDistance > 0 for location updates. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI528 | Sobriety: Vibration Free | Avoid using the device vibrator. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI529 | Sobriety: Thrifty Notification | Avoid vibration/sound in notifications. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| 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. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI531 | Sobriety: High Frame Rate | Avoid requesting high frame rates. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI532 | Privacy: Google Tracker | Avoid using Google tracking services. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI533 | GDPR: Google Ads Consent | Ensure Google Ads consent is properly implemented for GDPR compliance. | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI534 | Privacy: Tracking Id | Avoid tracking users via TelephonyManager#getDeviceId(). | π« | π« | π« | π« | π« | π« | π« | β | β | documentation | |
| GCI540 | Batch: Service Boot Time (XML) | Avoid starting services at device boot to reduce startup energy. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI541 | Idleness: Keep Screen On (XML) | Avoid android:keepScreenOn="true" in layouts. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI542 | Idleness: Keep Cpu On (XML) | Avoid WAKE_LOCK permission when not needed. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI543 | Power: Companion In Background (XML) | Avoid requesting BIND_COMPANION_DEVICE_SERVICE. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI544 | Power: Ignore Battery Optimizations (XML) | Avoid REQUEST_IGNORE_BATTERY_OPTIMIZATIONS. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI545 | Power: Charge Awareness (XML) | Declare battery-related broadcast receivers. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI546 | Power: Save Mode Awareness (XML) | Declare power save mode broadcast receivers. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI547 | Sobriety: Dark UI (Bright Colors) | Avoid bright colors in dark theme layouts. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI548 | Sobriety: Dark UI (Theme) | Provide a dark theme for the app. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| GCI549 | Sobriety: Hardware Acceleration (XML) | Disable hardware acceleration when not needed to reduce RAM usage. | π« | π« | π« | π« | π« | π« | π« | β | π« | documentation | |
| 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 | π« | π« | π | π« | π« | π« | π | π« | π« | ||
| 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 | π« | π« | π§ | π« | π« | π« | π« | π« | π« | ||
| 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 | π« | π« | π« | π« | π« | π« | π« | π« | π« | ||
| Non-outsourced CSS and Javascript | If you include CSS or JavaScript code in the body of the HTML file, while the HTML file is used by several pages (or even the entire site), this code must be transferred for each page requested by the user, which increases the volume of data transmitted. | cnumr best practices (3rd edition) BP_032 | π« | π« | π | π« | π« | π« | π | π« | π« | ||
| Resize images browser-side | Do not resize images using the HEIGHT and WIDTH attributes of the HTML code. This approach requires transferring these images to their original size, wasting bandwidth and CPU cycles. | cnumr best practices (3rd edition) BP_034 | π« | π« | π§ | π« | π« | π« | π | π« | π« | ||
| Modify the DOM when traversing it | Modifying the DOM (Document Object Model) as you traverse it can lead to situations where the loop becomes very resource-intensive, especially CPU cycles. | cnumr best practices (3rd edition) BP_041 | π« | π« | π§ | π« | π« | π« | π« | π« | π« | ||
| Edit DOM elements to make it invisible | When an element of the Document Object Model (DOM) needs to be modified by several properties, each change in style or content will generate a repaint or reflow. | cnumr best practices (3rd edition) BP_042 | π« | π« | π | π« | π« | π« | π« | π« | π« | ||
| GCI535 | Use native Intl.NumberFormat to format numbers | There's no need to use a library to display formatted numbers in a recent browser. Use Intl.NumberFormat for that use case. | π« | π« | π§ | π« | π« | π« | π« | π« | π« | documentation | |
| GCI603 | Animation Free | Animations play a crucial role in creating a dynamic UI but should be checked for unnecessary usage to avoid draining the battery. | π« | π« | π« | π« | π« | π« | π« | π« | β | documentation |
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 creedengo plugins. (Issues and PR are closed, but they can be reopen once rework 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 |
| GCI22 | 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 |
| GCI22 | PHP | The use of methods for basic operations | We have to measure this rule for PHP before accepting the implementation | Github discussion - issue |
| GCI53 | 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 creedengo 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 |
|---|
Refused / Deleted rules
This table lists rules proposed by the community but refused or/and deleted in creedengo 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 |
| GCI4 | Java | Avoid using global variables | Global variables do not exist in Java. | Github discussion with sources |
| GCI8 | JavaScript | Avoid using high accuracy geolocation | The rule has been merged with the rule GCI523 | Github discussion with sources |
| GCI34 | Python | Using try...catch...finally calls | Implementation is too simple (only detection of presence of "try" statement) AND replaced by GCI35 rule | Github discussion with measures : general/java / python |
| GCI34 | PHP | Using try...catch...finally calls | Implementation is too simple (only detection of presence of "try" statement) AND replaced by GCI35 rule | Github discussion with measures : general/java / php |
| GCI63 | Java | Unnecessarily assigning values to variables | There are already 3 native SonarQube rules for Java. | Github discussion with sources |
| GCI66 | Java | Use single quote (') instead of quotation mark (") | Finally, not applicable for Java | Discussed with core team |
| GCI66 | JS | Use single quote (') instead of quotation mark (") | No difference in performance | Discussed with core team |
| GCI66 | Python | Use single quote (') instead of quotation mark (") | Finally, not applicable for Python | Github discussion with sources |
| GCI66 | PHP | Use single quote (') instead of quotation mark (") | Finally, not applicable for PHP | Github discussion with sources |
| GCI69 | Python | Calling a loop invariant function in a loop condition | Finally, not applicable for Python | Github discussion with sources |
| GCI75 | Java | Don't concatenate strings in loops | Optimizations on Java concatenation Strings are useless since JDK8 | Github discussion with sources |