Seq nr | Name | Goal▲ | Type | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
601 | Names of character classes are not in the lowercase | Find regular expressions where the names of character classes are not completely in lowercase. For instance, incorrect is to write [[:UPPER:]] or [[:Upper:]] and correct is [[:upper:]]. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 13:22 | MIT License | |
602 | Duplicate specification of character classes | Find regular expressions where within the same specification of a character class the character class alnum as well as 0-9, \d, A-Z, or a-z has been defined. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-24 10:43 | MIT License | |
603 | Grantable roles | Find roles that a member can grant to others, i.e., the role has been granted with ADMIN OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | system catalog base tables only | 2024-01-07 13:42 | MIT License | |
604 | Gratuitous context in the names of parameters | Find routine parameter names that contain the routine name. Names of routine parameters shouldn't contain the name of the routine. It makes the names too long. A routine cannot have two parameters with the same name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
605 | Perhaps the type of a parameter should be BOOLEAN (based on parameter names) | Find routine parameters that based on the name seem to hold truth values. Find parameters that name starts with "is_" or "has_" or "can_" or "on_" and that do not have Boolean type. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-03 00:10 | MIT License | |
606 | Grantable routine privileges | Find routine privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-07 13:43 | MIT License | |
607 | Routines without an action | Find routines that body does not contain any action. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-05 12:14 | MIT License | |
608 | Sorting rows based on random values in routines without limiting rows | Find routines that contain a statement that sorts rows based on random values but do not limit the number of rows. This is unnecessary because without sorting the rows are returned in a unspecified order. Sorting based on random values is a computationally expensive operation. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-25 16:57 | MIT License | |
609 | Sorting rows based on random values in routines | Find routines that contain a statement that sorts rows based on random values. This can be used to find a random subset of rows. It is a computationally expensive operation. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-25 16:56 | MIT License | |
610 | User-defined routines that use xmin hidden column | Find 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. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:30 | MIT License | |
611 | Polymorphic routines | Find routines that have a parameter (input or output) that can have values from different types. This parameter has one of the PostgreSQL polymorphic types. The set of polymorphic types in PostgreSQL is a proper subset of its pseudo-types. The use of such a parameter allows a single routine definition to operate on many different data types, with the specific data type(s) being determined by the data types actually passed to it in a particular call. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 13:12 | MIT License | |
612 | User-defined routines with dynamic SQL that are potential targets of the SQL injection attack | Find routines that have at least one input parameter, use dynamic SQL but do not escape the input arguments at all. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:58 | MIT License | |
613 | Routine for reading data uses another routine to read some data | Find routines that only read data but invoke some other routine to read some more data. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-10 17:10 | MIT License | |
614 | Meaningless terms in routines | Find routines that subquery contains terms "foo", "bar", "foobar", or "baz". | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-06 14:09 | MIT License | |
615 | User-defined routines with dynamic SQL | Find routines that use dynamic SQL. Make sure that dynamic SQL is indeed needed, i.e., the task cannot be solved with static SQL. Make sure that the routine is protected against attacks that use SQL injection method. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:09 | MIT License | |
616 | FOR UPDATE is not needed if there is no FROM clause in the SELECT statement | Find routines that use SELECT … FOR UPDATE without selecting rows from a specific table. For instance: SELECT 'text' AS v FOR UPDATE; | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-05 14:10 | MIT License | |
617 | Perhaps inconsistent use of temporal functions | Find routines that use temporal functions CURRENT_TIMESTAMP, LOCALTIMESTAMP, or now() that is inconsistent with the default values of the columns that are used by the routine, e.g., function uses a column with the default value LOCALTIMESTAMP but the routine uses function CURRENT_TIMESTAMP or now(). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-10 17:11 | MIT License | |
618 | Something is still to do in routines | Find routines where comments contain TODO phrase. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-11 12:44 | MIT License | |
619 | Do not refer to the table schema in the references to columns | Find routines where in SELECT or UPDATE statements references to columns are prefixed with references to the table schema. Referring to schema in this context bloats the code. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 17:32 | MIT License | |
620 | Routine body with ordering the query result based on positional references | Find routines where the query result is sorted based on the column number in the SELECT clause. Such query is sensitive towards changing the order of columns in the SELECT clause, i.e., if one changes the order of columns in the SELECT clause, then one must change the numbers in the ORDER BY clause as well, otherwise the query will produce undesired order of rows. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-31 15:23 | MIT License |