Seq nr | Name | Goal | Type▲ | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
781 | The name of the base table that implements a binary relationship type does not explain the meaning of the relationship | Find base tables that implement a binary relationship type (have two foreign keys) and the name of the table consist of the names of tables that this (intermediate) table connect. The names should be derived from the domain. For instance, instead of name Course_Lecturer it is better to have name Teaching. | Problem detection | system catalog base tables only | 2023-03-18 17:58 | MIT License | |
782 | The name of the routine does not match with the action of the routine | Find user-defined non-trigger SQL and PL/pgSQL routines where the beginning of the name of the routine indicates a certain action inside the routine (INSERT, UPDATE, or DELETE) but there is no such statement in the routine body. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-11-19 14:37 | MIT License | |
783 | The reference to a database operation is missing from a comment | Find user-defined routines that comment does not contain a reference to a database operation that the routine implements. In case of routines that have been created based on the contracts of database operations, one should refer to the short identifier of the operation in the comment of the routine. The operation identifier must be in this case in the form OP | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:39 | MIT License | |
784 | There is no reason to use PL/pgSQL if you do not use one or more features of a procedural language | Using PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs (variables, conditional statements, cycles, cursors, exception handling). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 16:32 | MIT License | |
785 | There is no reason to use PL/pgSQL to write table functions | Using PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs. You can create table functions by using SQL. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:28 | MIT License | |
786 | The same CHECK has a different name in different places | Find the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | system catalog base tables only | 2023-01-14 20:47 | MIT License | |
787 | The same name is used in different contexsts | Find the names that are used in case of different types of elements | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-03-17 10:33 | MIT License | |
788 | The same sequence generator is used in case of multiple columns | Do not cause a potential performance bottleneck by having a shared resource. By having a shared sequence it is not possible to change properties of sequences of different tables independently (for instance the owner column or step), i.e., it increases coupling between tables. By having a shared sequence it is impossible to specify the owner (table column) to the sequence generator. | Problem detection | INFORMATION_SCHEMA only | 2021-03-07 21:07 | MIT License | |
789 | The SQL-language routines with the body that is string literal | Find SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-24 18:20 | MIT License | |
790 | Three-valued logic (Boolean columns) | Find base table columns that have Boolean type and 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 Boolean columns mandatory. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
791 | 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 | |
792 | 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 | |
793 | Too generic names (candidate key columns) | Find candidate key columns with the names like id, identifikaator, code, kood, number, etc. The names should have a prefix or a suffix. These are too generic names. | Problem detection | system catalog base tables only | 2023-01-20 12:35 | MIT License | |
794 | 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 | |
795 | 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 | |
796 | Too generic names (domain constraints) | Find domain CHECK constraints that have a too generic name - for instance, the name contains word "data" ) or the name is an abbreviation of the constraint type name (for instance, "chk" or "chk1"). | Problem detection | INFORMATION_SCHEMA only | 2021-10-31 17:39 | MIT License | |
797 | Too generic names (foreign key columns) | Find foreign key columns with the names like id, identifikaator, code, kood, number, etc. The names should have a prefix or a suffix that describes the nature of relationship with the referenced table or at least referes to the referenced table. These are too generic names. | Problem detection | system catalog base tables only | 2023-01-20 12:37 | MIT License | |
798 | 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 | |
799 | 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 | |
800 | 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 |