Skip to content

G-2185: Avoid using overly short names for explicitly or implicitly declared identifiers.

Major

Maintainability

Reason

You should ensure that the name you have chosen well defines its purpose and usage. While you can save a few keystrokes typing very short names, the resulting code is obscure and hard for anyone besides the author to understand.

Example (bad)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
declare
   i integer;
   c constant integer := 1; -- violates also naming conventions (G-9114)
   e exception;             -- violates also naming conventions (G-9113)
begin
   i := c;
   do_something(i);
exception
   when e then
      null;
end;
/

Example (good)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
declare
   l_sal_comm     integer;
   co_my_constant constant integer := 1;
   e_my_exception exception;
begin
   l_sal_comm := co_my_constant;
   do_something(l_sal_comm);
exception
   when e_my_exception then
      null;
end;
/