Trivadis / plsql-cop-cli

db* CODECOP Command Line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

False postive for G-7430 in functions when declare section contains other functions

PhilippSalvisberg opened this issue · comments

Violations of G-7430 is reported in the following case:

create or replace function f1 return integer is
   function f2 return integer is
      function f3 return integer is
      begin
         return 3; -- G-7430 false positive
      end;
   begin
      return f3; -- G-7430 false positive
   end;
begin
   return f2; -- G-7430 false positive
end;
/

On line 5, 8 and 11. These are false positives. The scope of a function is not considered. Every function has in fact just one return statement.

Furthermore, this is reported twice in the case of standalone functions. Once per CreateFunction and once per FunctionDefinition.