rules repository

A-1750 Avoid static lists without entries.

Severity Warning Check + SQL-based Test Free New

Reason

A static list with no entries renders nothing and serves no purpose. It is usually a leftover from refactoring — either the entries were removed, or the list was created and never populated.

Add the intended entries, or delete the list from Shared Components if it is unused.

Example

Non-Compliant Example

list order-actions (
    name: Order Actions
)
Issues
LineColumnMessage
16Static list has no entries.

Compliant Solution - ★★★★★

list order-actions (
    name: Order Actions

    entry submit (
        label: Submit
        // ...
    )
)

Tests

Test SQL query

select aa.workspace || '.' || aa.alias || '.' || al.list_name as identifier,
       'Static list ' || al.list_name || ' of app ' || aa.alias || ' in ' || aa.workspace
         || ' has no entries.' as message
  from apex_application_lists al
  join apex_applications aa
    on aa.application_id = al.application_id
       and aa.workspace = al.workspace
 where al.list_type = 'Static'
   and not exists (select 1 from apex_application_list_entries le
                    where le.list_id = al.list_id)
   and aa.workspace in (#ApexWorkspaces#)

Test results

IdentifierMessageMigration
WORKSPACE.CUSTOMERS.Order ActionsStatic list Order Actions of app CUSTOMERS in WORKSPACE has no entries.-

Parameters

Use parameters to customize the rule to your needs.

ParameterDescriptionDefault Value
ApexWorkspacesComma-separated List of APEX workspaces owning APEX applications to check.dblinter, dbl_gui

References