Code smells
In OutSystems, code smells are similar to those in other programming languages and refer to symptoms or characteristics in the code that suggest there may be a deeper problem. Here are some examples of code smells in OutSystems:
-
Large or complex modules: A module that does too much, contains too many actions or logic, or is difficult to navigate can be a sign of poor design.
-
Duplicate or redundant logic: Having the same logic or code repeated in multiple places can lead to maintenance issues and errors.
-
Use of system entities as data structures: Using the OutSystems platform’s built-in system entities, such as User or Role, as data structures can lead to issues with scalability and performance.
-
Long server actions or client actions: Actions that perform too many tasks or contain too much logic can be hard to understand and maintain.
-
Inconsistent naming conventions: Inconsistent naming of variables, actions, or elements can make the code difficult to read and understand.
-
Use of magic values: Hardcoding values, such as numbers or strings, can lead to errors and make it difficult to update the code in the future.
-
Overuse of global variables or session variables: Overuse of global variables or session variables can lead to issues with data integrity, and make the code difficult to test and maintain.
-
Lack of error handling: Not properly handling exceptions and errors can lead to unexpected behavior or crashes.
Identifying code smells in OutSystems is an essential part of code review, and addressing them early in the development process can improve the maintainability, performance, and quality of the code.