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 keyNameDescriptionReference/ValidationJavaPhpJSPythonRustC#HTMLMobile AndroidMobile iOSSource reference
CRJVM205Force usage of FetchType LAZY for collections on JPA entitiesπŸš§β“β“β“β“β“πŸš«πŸš«πŸš«
CRJVM206Avoid N+1 selects problemπŸš§β“β“β“β“β“πŸš«πŸš«πŸš«
CRJVM207Customer data must have end-of-life informationπŸš§β“β“β“β“β“β“πŸš«πŸš«
CRJVM???Persistence Java : Avoid Joints on non indexed columnsπŸš§β“β“β“β“β“πŸš«πŸš«πŸš«
GCI1Calling a Spring repository inside a loop or a streamThe use of Spring repository in a loop or a stream induces unnecessary calculations by the CPU and therefore superfluous energy consumption.βœ…πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI2Multiple if-else statementsUsing 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
GCI3Getting the size of the collection in the loopWhen 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
GCI4Use global variablesWhen 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
GCI5Usage of preparedStatement instead of StatementSQL 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
GCI7Rewrite native getter/settersOverloading 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
GCI9Importing everything from library should be avoidedESLint key : @creedengo/no-import-all-from-library /// type : Commonβ“β“βœ…β“β“β“πŸš«πŸš«πŸš«documentation
GCI10Use unoptimized vector imagesLess heavy SVG images using less bandwidthcnumr best practices (3rd edition) BP_036πŸš€πŸš€πŸš€βœ…πŸš€πŸš«β“πŸš«πŸš«documentation
GCI11Multiple access of same DOM element should be limitedESLint key : @creedengo/no-multiple-access-dom-element /// type : Front-endπŸš«β“βœ…πŸš«πŸš«β“πŸš«πŸš«πŸš«documentation
GCI12Multiple style changes should be batchedESLint key : @creedengo/no-multiple-style-changes /// type : Front-endπŸš«β“βœ…πŸš«πŸš«β“πŸš«πŸš«πŸš«documentation
GCI13API collections should be preferred with paginationESLint key : @creedengo/prefer-collections-with-pagination /// type : Back-endβ“β“βœ…β“β“β“πŸš«πŸš«πŸš«documentation
GCI22The use of methods for basic operationsUsing 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
GCI24Returned SQL results should be limitedESLint key : @creedengo/limit-db-query-results /// type : Back-endπŸš§πŸš€βœ…βœ…πŸš€πŸš€πŸš«πŸš«πŸš«documentation
GCI25Images should not have an empty source attributeESLint key : @creedengo/no-empty-image-src-attribute /// type : Front-endβ“β“βœ…β“β“β“πŸš€πŸš«πŸš«documentation
GCI26Shorthand CSS notations should be used to reduce stylesheets sizeESLint key : @creedengo/prefer-shorthand-css-notations /// type : Front-endβ“β“βœ…β“β“β“πŸš«πŸš«πŸš«documentation
GCI27Usage of system.arraycopy to copy arraysPrograms 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
GCI28Optimize read file exceptionsβœ…πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI29CSS animations should be avoidedESLint key : @creedengo/avoid-css-animations /// type : Front-endβ“β“βœ…β“β“β“πŸš«πŸš«πŸš«documentation
GCI30Print stylesheet should be providedESLint key : @creedengo/provide-print-css /// type : Front-endβ“β“βœ…β“β“β“πŸš«πŸš«πŸš«documentation
GCI31Lighter formats should be used for image filesESLint key : ... /// type : ...πŸš§β“βœ…β“β“β“πŸš€πŸš«πŸš«documentation
GCI32Initialize builder/buffer with the appropriate sizeIf 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
GCI35Using 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
GCI36Autoplay should be avoided for video and audio contentAutoplaying media consumes unnecessary energy, especially when users might not be actively engaging with the content.cnumr best practices BP_4003πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš§πŸš«πŸš«documentation
GCI66Use 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
GCI67Use the $i++ variable during an iterationThe i++formhasthedisadvantageofgeneratingatemβˆ’poraryvariableduringincrementation,whichisnotthecasewiththe++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)βœ…βœ…πŸš€πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI69Calling a loop invariant function in a loop conditionAvoid calling loop invariant functions in loop conditions.cnumr best practices (3rd edition) BP_069 (no longer exists in edition 4)βœ…βœ…πŸš€πŸš«πŸš€βœ…πŸš«πŸš«πŸš«documentation
GCI72Perform an SQL query inside a loopServers 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
GCI74Write SELECT * FROMThe 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
GCI75Don't concatenate strings in loopsAvoid repeated string allocations and consider using a StringBuilder instead.πŸš«β“β“β“β“βœ…πŸš«πŸš«πŸš«documentation
GCI76Usage of static collectionsAvoid 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
GCI77Usage Pattern.compile() in a non-static contextAvoid 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
GCI78Const parameter in batch updateDon't set const parameter in batch update => Put its in query. Creating this parameter and destroying it consumes CPU cycles and RAM unnecessarily.βœ…πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI79Free resourcestry-with-resources Statement needs to be implemented for any object that implements the AutoCloseable interface, it save computer resources.βœ…πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI81Specify struct layoutsWhen possible, specify struct layouts to optimize their memory footprintπŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«documentation
GCI82Make variable constantA variable is never reassigned and can be made constantβœ…πŸš€πŸš€πŸš€πŸš€βœ…πŸš«πŸš«πŸš«documentation
GCI83Replace Enum ToString() with nameofWhen no string format is applied, use nameof instead of ToString() for performanceπŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«documentation
GCI84Avoid async void methodsUse async Task methods instead, for performance, stability and testabilityπŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«documentation
GCI85Make type sealedSeal types that don't need inheritance for performance reasonsπŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«documentation
GCI86GC.Collect should not be calledIn most cases, the cost of calling GC.Collect far outweighs the benefitsπŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«documentation
GCI87Use collection indexerCollection indexers should be used instead of Linq, when availableπŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«documentation
GCI88Dispose resource asynchronouslyResources that implement IAsyncDisposable should be disposed asynchronouslyπŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«documentation
GCI89Avoid using function cache without limitIf a function has decorators without max size cache, the program will store unlimited dataβ“β“β“βœ…β“β“β“πŸš«πŸš«documentation
GCI90Use Cast instead of Select to castCast is optimized for this scenario and should be usedβ“β“β“β“β“βœ…β“πŸš«πŸš«documentation
GCI91Use filter feature before sort elementsFilter elements before sorting them for improved efficiencyπŸš§β“β“β“β“βœ…β“πŸš«πŸš«documentation
GCI92Use string.Length instead of comparison with empty stringComparing 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
GCI93Return Task directlyConsider returning a Task directly instead of a single awaitβ“β“β“β“β“βœ…β“πŸš«πŸš«documentation
GCI94Use orElseGet instead of orElseParameter 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
GCI95Avoid querying SQL columns that are not usedWhen 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
GCI96Data / AI : Pandas - Avoid Reading Unnecessary Columns in CSV FilesReading CSV files without explicitly specifying which columns to load leads to unnecessary data loading and increases memory and energy consumption.πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI97Optimize square computation (scalar vs vectorized method)In Python, if you want to square x, you can do x*x or x**2.β“β“β“βœ…β“β“β“πŸš«πŸš«documentation
GCI98Avoid raising Runtime Exceptions when a check is possibleYou 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
GCI99Data : Avoid CSV FormatThe 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
GCI100AI : 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
GCI101AI : Avoid Bias in Conv Layers Before Batch NormDisable bias in convolutional layers when it's followed by a batch norm layerπŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI102AI : Use pinned memory on DataLoader when using GPUThis rule applies to PyTorch data loading, where the use of pinned memory can significantly optimize data transfer between CPU and GPU.πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI103Don't use .items() to iterate over a dictionary when only keys or values are neededAvoid 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
GCI104Data / AI : PyTorch - Create tensors directly from TorchIn 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
GCI105Python String ConcatenationPython String Concatenation - Use Join Instead or f-Strings instead of +=πŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI106Avoid Square Root Operations In LoopUsing scalar math.sqrt (or numpy.sqrt on individual values) inside loops leads to inefficient codeπŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI107Data : Avoid Iterative Matrix OperationsUse vectorization by the usage of the built-in functions of TensorFlow, NumPy or PandasπŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI108Prefer Append LeftWhen you want to insert an element at the beginning of a list, it's better to use a deques or a double linkedlist.β“β“β“βœ…β“β“β“πŸš«πŸš«documentation
GCI109Avoid Using Exceptions for Control FlowUsing 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
GCI110Python: 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
GCI111Logging format interpolationWhen 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
GCI112Reduce memory footprint of dataclassesUsing 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
GCI113Prefer XGBoost to RandomForestUsing XGBoost offers a more optimized and eco-friendly alternative with competitive accuracy than RandomForest.πŸš«πŸš«πŸš«πŸš€πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI203Detect unoptimized file formatsWhen it is possible, to use svg format image over other image formatπŸš§πŸš€πŸš€βœ…πŸš€πŸš€πŸš«πŸš«πŸš«documentation
GCI404Avoid list comprehension in iterationsUse generator comprehension instead of list comprehension in for loop declarationπŸš«πŸš«πŸš«βœ…πŸš«πŸš«πŸš«πŸš«πŸš«documentation
GCI500Batch: Sensor CoalesceUse maxReportLatencyUs to batch sensor events and reduce CPU wake-ups.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI501Batch: Job CoalesceUse JobScheduler to batch network operations and reduce radio wake-ups.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI502Bottleneck: Internet In The LoopAvoid network calls inside loops to reduce radio usage.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI503Bottleneck: Wifi Multicast LockRelease Wifi multicast locks to allow the radio to sleep.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI504Bottleneck: Uncompressed Data TransmissionCompress data before transmission to save bandwidth and energy.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI505Idleness: Keep Screen On (addFlags)Avoid keeping the screen on via addFlags to save battery.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI506Idleness: Keep Screen On (setFlags)Avoid keeping the screen on via setFlags to save battery.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI507Idleness: Keep Cpu OnAvoid keeping the CPU on with PARTIAL_WAKE_LOCK.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI508Idleness: Durable Wake LockRelease wake locks promptly to allow the device to sleep.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI509Idleness: Rigid AlarmUse inexact alarms to allow the system to batch wake-ups.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI510Idleness: Continuous RenderingAvoid RENDERMODE_CONTINUOUSLY for OpenGL surfaces.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI511Idleness: Keep Voice AwakeRelease voice recognition resources when not needed.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI512Leakage: Camera LeakRelease camera resources when no longer needed.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI513Leakage: Location LeakStop location updates when no longer needed.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI514Leakage: SensorManager LeakUnregister sensor listeners when no longer needed.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI515Leakage: Media Leak (MediaRecorder)Release MediaRecorder when no longer needed.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI516Leakage: Media Leak (MediaPlayer)Release MediaPlayer when no longer needed.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI517Optimized API: Fused LocationUse FusedLocationProviderClient instead of raw GPS.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI518Optimized API: Bluetooth Low-EnergyUse BLE APIs instead of classic Bluetooth.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI519Power: Charge AwarenessMonitor battery level and adapt behavior accordingly.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI520Power: Save Mode AwarenessDetect power save mode and reduce activity.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI521Sobriety: Thrifty Motion SensorUse appropriate sensor delay for motion sensors.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI522Sobriety: Brightness OverrideTo avoid draining the battery, iOS and Android devices adapt the brightness of the screen depending on the environment light.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI523Sobriety: Thrifty Geolocation (minTime)High-precision geolocation typically requires more power from the device's GPS hardware.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI524Sobriety: Thrifty Geolocation CriteriaUse appropriate accuracy criteria for geolocation.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI525Sobriety: Thrifty BLE (setAdvertiseMode)Use low-power BLE advertising mode.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI526Sobriety: Thrifty BLE (requestConnectionPriority)Use balanced BLE connection priority.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI527Sobriety: Thrifty Geolocation (minDistance)Set minDistance > 0 for location updates.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI528Sobriety: Vibration FreeAvoid using the device vibrator.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI529Sobriety: Thrifty NotificationAvoid vibration/sound in notifications.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI530Sobriety: Torch FreeTurning on the torch mode programmatically must absolutely be avoided because the flashlight is one of the most energy-intensive component.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI531Sobriety: High Frame RateAvoid requesting high frame rates.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI532Privacy: Google TrackerAvoid using Google tracking services.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI533GDPR: Google Ads ConsentEnsure Google Ads consent is properly implemented for GDPR compliance.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI534Privacy: Tracking IdAvoid tracking users via TelephonyManager#getDeviceId().πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…βœ…documentation
GCI540Batch: Service Boot Time (XML)Avoid starting services at device boot to reduce startup energy.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI541Idleness: Keep Screen On (XML)Avoid android:keepScreenOn="true" in layouts.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI542Idleness: Keep Cpu On (XML)Avoid WAKE_LOCK permission when not needed.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI543Power: Companion In Background (XML)Avoid requesting BIND_COMPANION_DEVICE_SERVICE.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI544Power: Ignore Battery Optimizations (XML)Avoid REQUEST_IGNORE_BATTERY_OPTIMIZATIONS.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI545Power: Charge Awareness (XML)Declare battery-related broadcast receivers.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI546Power: Save Mode Awareness (XML)Declare power save mode broadcast receivers.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI547Sobriety: Dark UI (Bright Colors)Avoid bright colors in dark theme layouts.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI548Sobriety: Dark UI (Theme)Provide a dark theme for the app.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
GCI549Sobriety: Hardware Acceleration (XML)Disable hardware acceleration when not needed to reduce RAM usage.πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«βœ…πŸš«documentation
Use official social media sharing buttonsThese 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 declarationsWhen 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 usedPrefer 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 JavascriptIf 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-sideDo 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 itModifying 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 invisibleWhen 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πŸš«πŸš«πŸš€πŸš«πŸš«πŸš«πŸš«πŸš«πŸš«
GCI535Use native Intl.NumberFormat to format numbersThere's no need to use a library to display formatted numbers in a recent browser. Use Intl.NumberFormat for that use case.🚫🚫🚧🚫🚫🚫🚫🚫🚫documentation
GCI603Animation FreeAnimations 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 keyLanguageNameDescriptionInvalidation
CRJVM204JavaDetect unoptimized file formatsWe have to clarify and rework this rule for Java before accepting the implementationGithub discussion - issue
Github discussion - PR
GCI22JavaThe use of methods for basic operationsWe have to measure this rule for Java before accepting the implementationGithub discussion - issue
Github discussion - PR
GCI22PHPThe use of methods for basic operationsWe have to measure this rule for PHP before accepting the implementationGithub discussion - issue
GCI53JavaUsing arrays in foreach loopsNo good arguments and not enough green measures.Github discussion with sources
GRSP0007PHPPrefer using foreachWe have to clarify and measure this rule for PHP before accepting the implementationGithub discussion - PR
GRSP0008PHPAvoid using relative pathWe have to clarify and measure this rule for PHP before accepting the implementationGithub discussion - PR
JavaAvoid returning a JPA Entity in a RestControllerWe have to clarify and measure this rule for Java before accepting the implementationGithub 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 keyLanguageNameDescriptionInvalidation

Refused / Deleted rules

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

Rule keyLanguageNameDescriptionInvalidation
CRDOM203HTMLHTML page must contain a doctype tagThe difference in performance is negligible, this rule is more related to the user experience.Github discussion with sources
CRPYTPythonUse numpy array instead of standard listThe use of numpy library to perform array manipulation is more energy efficient than the use of the standard list functions.Github discussion with measures
GCI4JavaAvoid using global variablesGlobal variables do not exist in Java.Github discussion with sources
GCI8JavaScriptAvoid using high accuracy geolocationThe rule has been merged with the rule GCI523Github discussion with sources
GCI34PythonUsing try...catch...finally callsImplementation is too simple (only detection of presence of "try" statement) AND replaced by GCI35 ruleGithub discussion with measures : general/java / python
GCI34PHPUsing try...catch...finally callsImplementation is too simple (only detection of presence of "try" statement) AND replaced by GCI35 ruleGithub discussion with measures : general/java / php
GCI63JavaUnnecessarily assigning values to variablesThere are already 3 native SonarQube rules for Java.Github discussion with sources
GCI66JavaUse single quote (') instead of quotation mark (")Finally, not applicable for JavaDiscussed with core team
GCI66JSUse single quote (') instead of quotation mark (")No difference in performanceDiscussed with core team
GCI66PythonUse single quote (') instead of quotation mark (")Finally, not applicable for PythonGithub discussion with sources
GCI66PHPUse single quote (') instead of quotation mark (")Finally, not applicable for PHPGithub discussion with sources
GCI69PythonCalling a loop invariant function in a loop conditionFinally, not applicable for PythonGithub discussion with sources
GCI75JavaDon't concatenate strings in loopsOptimizations on Java concatenation Strings are useless since JDK8Github discussion with sources