Seq nr | Name | Goal | Type | Data source▲ | Last update | License | ... |
---|---|---|---|---|---|---|---|
701 | The use of xmin hidden column in views and routines | Find the number of views and materialized views that have a column with the xid type and the number of routines that contain a UPDATE or a DELETE statement that search condition refers to the xmin column. If one uses optimistic approach for dealing with the concurrent modifications of data, then xmin values should be presented by views and used in routines that modify or delete rows. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:56 | MIT License | |
702 | Three-valued logic (non-Boolean columns) | Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have NOT NULL constraint. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the columns mandatory. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-20 14:07 | MIT License | |
703 | Too few rounds in case of calculating the hash | Find user-defined routines where gen_salt function is used with the number of rounds that is smaller than 12. The number should be adjusted based on the hardware where the system resides. Password hashing should take at least 250 ms. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-25 17:21 | MIT License | |
704 | Too generic names (columns) | Find the names of columns that are too generic. In SQL databases data/information is represented as values in columns. It is not a good style to use generic words like data, information, column, etc. In the names of columns. Moreover, avoid too generic column names like: id, tyyp, kood, aeg, kp,type, code, time, date, fk, pk. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-15 10:33 | MIT License | |
705 | Too generic names (columns) (there is a column with a more specific name in the table) | Find column names in case of which the same table has another column (with more specific name) that name contains the column name in the end or in the beginning. For instance, a base table has columns parent and root_parent and the former col-umn name is too generic, i.e., it should be more specific. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-03-20 01:01 | MIT License | |
706 | Too generic names (parameters) | Find the names of parameters that are too generic. The routines work with data/information. Thus, it is not a good style to use generic words like data, information, parameter, etc. In the names of parameters. Moreover, avoid too generic parameter names like: id, tyyp, kood, aeg, kp,type, code, time, date, fk, pk, param. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-20 14:08 | MIT License | |
707 | Too generic names (parameters) (there is a parameter with a more specific name in the routine) | Find parameter names in case of which the same routine has another parameter with the same mode but with more specific name, i.e., the name contains the parameter name in the end or in the beginning. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-06 12:03 | MIT License | |
708 | Too generic names regarding persons and their names (columns of derived tables) | Find derived table columns that name refers to the possibility that these contain person names. The names of derived table columns that contain person names should refer to the role that the corresponding entity type has in the view. For instance, if view active_product has a column with the name surname, then the column name does not give information what is the role of the person in the context of the view. Better name would be, for instance, registrator_surname. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-11-10 14:25 | MIT License | |
709 | Too generic names (routines) | "Avoid using the same word for two purposes. Using the same term for two different ideas is essentially a pun" (Robert C. Martin, Clean Code) Do not use the Estonian words like 'lisa', 'muuda', 'kustuta' or the corresponding English words 'add', 'delete', 'update' as the names of routines because it would make the code much less understandable. What is the task of the routine f_add? Register people? Register orders? What? Do not refer to the generic concepts like data and information because all routines work with these. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-07 20:38 | MIT License | |
710 | Too generic names (tables) | Find the names of tables that are too generic. In SQL databases data/information is represented as values in columns. It is not a good style to use generic names like table, data, information, list etc. in the names of tables. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-07 20:37 | MIT License | |
711 | Too short names of database objects | "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) The names should be meaningful and searchable. Find the names (identifiers) of user-defined database objects that are shorter than three characters. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-03-19 11:07 | MIT License | |
712 | Too short or missing comments of derived tables and routines | Find views, materialized views, and user-defined routines that do not have a comment at all or the comment is shorter than twice the length of the object name, or the comment states that it is missing (TODO). You should give information to future developers and maintainers of the system (including the future version of yourself). Do not just repeat the name in the comment (with perhaps some rewording). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-19 12:56 | MIT License | |
713 | Too wide derived (dependent) table | Find derived tables (views, materialized views) that are based on more than five tables and that have more than 15 columns. This view might produce "a denormalized world view" where all the data is together in one table and applications make queries based on this single view to fulfill their specific tasks. Such view does not follow the separation of concerns principle. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-12-13 12:34 | MIT License | |
714 | Transform method does not return | Find user-defined SQL and PL/pgSQL routines that do not return a value although the name suggest that it should return a value (contains "_to_"). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-14 19:37 | MIT License | |
715 | Trigger functions with a conditional statement | Find trigger functions that contain a conditional (IF or CASE) but do not contain a SELECT statement before these. The latter condition is for the reason that one cannot use a subquery in the WHEN clause. Thus, if one wants to make a query and decide the further action based on the results of the query, then one must do it within the body of the function. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-19 12:07 | MIT License | |
716 | Trigger is used to enforce referential integrity | Find tables where user-defined (non-system) triggers are used to implement referential integrity. In addition to table name show the triggers and the number of triggers. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
717 | Trigger routines with TG_OP variable that are not associated with a suitable trigger | Automatically defined TG_OP variable in a trigger function has data type text. Its value is a string of INSERT, UPDATE, DELETE, or TRUNCATE telling for which operation the trigger was fired. Find the routines that according to the TG_OP value must react to a certain operation but the routine is not associated with any triggers that are fired by the operation. For instance, the routine specifies reaction to DELETE operation but the routine is not associated with any DELETE trigger. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-12-25 01:26 | MIT License | |
718 | Triggers with arguments from the CREATE TRIGGER statement | Find triggers that get an argument from the CREATE TRIGGER statement. | General | INFORMATION_SCHEMA+system catalog base tables | 2023-12-22 12:35 | MIT License | |
719 | Triggers with SELECT (i.e., probably check data based on another table) | If a trigger is used for enforcing a constraint, then it should take into account that due to the implementation of multiversion concurrency control (MVCC) in PostgreSQL, reading data does not block data modification and vice versa. Thus, there may be a need to lock the entire table or some row explicitly. | General | INFORMATION_SCHEMA+system catalog base tables | 2020-11-06 14:51 | MIT License | |
720 | Triggers with the same name in different schemas | Find trigger names that are used in a database in more than one schema. Different things should have different names. But here different triggers have the same name. Also make sure that this is not a duplication. | General | INFORMATION_SCHEMA+system catalog base tables | 2020-11-06 14:51 | MIT License |