Seq nr | Name | Goal | Type | Data source | Last update▼ | License | ... |
---|---|---|---|---|---|---|---|
601 | Mixing the use of TEXT and VARCHAR type in case of base table columns | Declaring a column to have the type TEXT or the type VARCHAR (without the maximum number of characters) has the same end result in terms of what data can be recorded in the column. Nevertheless, one should try to stick with using one of the type names in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | INFORMATION_SCHEMA only | 2021-03-12 15:06 | MIT License | |
602 | Do not format comma-separated lists (based on user data) | Find, based on the data that users have recoreded in a database, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-12 15:02 | MIT License | |
603 | Do not register duration | Find columns of base and foreign tables that based on the column name and type are used to register duration (including the age). | Problem detection | INFORMATION_SCHEMA only | 2021-03-12 14:48 | MIT License | |
604 | Different foreign key column names in case of referencing the same candidate key | Find the cases when the names of columns in different foreign keys that reference to the same candidate key are different. If different names reflect different roles, then it is legitimate. However, there could also be accidental differences that makes it more difficult to use the database. | Problem detection | system catalog base tables only | 2021-03-12 11:21 | MIT License | |
605 | Referential degree of tables | This metric represents the number of foreign keys in a base table. | Sofware measure | INFORMATION_SCHEMA only | 2021-03-12 11:07 | MIT License | |
606 | Referential degree of tables (ver 2) | Find how many base tables are referenced from a base table by using foreign keys. | Sofware measure | system catalog base tables only | 2021-03-12 11:06 | MIT License | |
607 | The number of referencing base tables | Find how many base tables reference to a base table by using foreign keys. The more references there are the more impact the change of the table could have to the overall system. | Sofware measure | system catalog base tables only | 2021-03-12 11:02 | MIT License | |
608 | Potentially a classifier is missing (based on field sizes) | Find columns that are not covered by a primary key, unique, and foreign key constraint but have a textual type with the maximum field size 3 or less. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-03-10 13:07 | MIT License | |
609 | Do not assume you must use files (based on user data) | Find cases where you store images and other media as files outside the database and store in the database only paths to the files. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-10 12:58 | MIT License | |
610 | Do not format comma-separated lists (based on column names) | Find, based on column names, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table or a foreign table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters. | Problem detection | INFORMATION_SCHEMA only | 2021-03-10 12:57 | MIT License | |
611 | Do not leave out the referential constraints (islands) | Try to find missing foreign key constraints. Find base tables that do not participate in any referential constraint (as the referenced table or as the referencing table). These tables are like "islands" in the database schema. | Problem detection | system catalog base tables only | 2021-03-10 12:20 | MIT License | |
612 | Inconsistency of using column data types/field sizes in case of columns that implement relationships | Find foreign key constraints where the candidate key columns (belong to a PRIMARY KEY/UNIQUE constraint) and foreign key columns do not have the same data type and field size. Primary key/unique columns and foreign key columns should have the same data type and field size. If, for instance, the primary key column has type INTEGER and foreign key column has type SMALLINT, then one cannot use all the primary key values as foreign key values. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-10 12:13 | MIT License | |
613 | Some candidate key values cannot be used as foreign key values | Find foreign key constraints in case of which some candidate key values cannot be used as foreign key values. Primary key/unique columns and foreign key columns should have the same data type and field size. If, for instance, the primary key column has type INTEGER and foreign key column has type SMALLINT, then one cannot use all the primary key values as foreign key values. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-10 12:13 | MIT License | |
614 | Foreign key references a non-key (has optional columns) | Find foreign key constraints that referenced column is optional. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-10 12:12 | MIT License | |
615 | Simple natural primary keys | Find primary keys that consist of one column and that values are not generated by the system. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-03-08 00:47 | MIT License | |
616 | Potentially missing sequence generators (based on column names and types) | Find surrogate key columns that do not have an associated sequence generator. Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there are no sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-08 00:44 | MIT License | |
617 | Foreign key columns that are associated with a sequence generator | Find foreign key columns that are associated with a sequence generator. Foreign key values are selected amongst the values that are registered as corresponding primary key/unique key values. Values in the foreign key columns are not directly generated by the system. These values might be system generated indirectly - generated when a row is added to the primary (parent) table. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-08 00:42 | MIT License | |
618 | Mixing different mechanisms to generate surrogate values | Use the same mechanism of generating surrogate key values throughout the database. The use of SERIAL notation/explicitly creating a sequence generator and declaration of a column as an identity column will cause the creation of an external and internal sequence generator, respectively. Nevertheless, one should try to stick with using one of the mechanisms in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | INFORMATION_SCHEMA only | 2021-03-08 00:42 | MIT License | |
619 | Base tables that have only the surrogate key and do not have any other column | Do not create unnecessary tables. If a table has cardinality 1 (one column), then most probably the values in this column should not be system generated unique values. | Problem detection | INFORMATION_SCHEMA only | 2021-03-08 00:41 | MIT License | |
620 | Multiple columns in the same base table that are associated with a sequence generator | Find base tables where multiple columns are associated with a sequence generator. Do not create unnecessary sequence generators. If one uses in a table a surrogate key, then it is enough to have one column where the values are generated by using a (external or internal) sequence generator. | Problem detection | INFORMATION_SCHEMA only | 2021-03-08 00:41 | MIT License |