Toad World® Forums

Formatter: code review 512


#1

the 512 advice cuts the function parameters declaration making
difficult to read the code

example:
FUNCTION testa (pct_code IN tabela_a.code%TYPE,
/*ADVICE(19): Function with more than one RETURN statement in the
executable section [512] */
pct_id IN tabela_b.id%TYPE DEFAULT NULL)
RETURN BOOLEAN

Thanks
Filipe


#2

Hi Filipe,

Thanks for finding this out. I agree with you. It looks like the rule 512 points to the name of the function so it was inserted to the line right after function name. The same issue also happens to rule 552 and rule 131. It would be great if we place them after the parameter list. I will create CR for this but I don’t know if we have time for this targeting to 6.2. I will keep you posted.

Thanks,
Vincent

/* Formatted on 3-Apr-2009 8:36:10 (QP5 v5.126) */
FUNCTION testa (pct_code IN tabela_a.code%TYPE,
/*ADVICE(2): Function with more than one RETURN statement in the
executable section [512] */
/*ADVICE(2): Unreferenced parameter [552] */
/*ADVICE(2): This item has not been declared, or it refers to a label [131] */
pct_id IN tabela_b.id%TYPE DEFAULT NULL)
/*ADVICE(7): Unreferenced parameter [552] */
/*ADVICE(7): This item has not been declared, or it refers to a label [131] */
RETURN BOOLEAN
IS
BEGIN
IF 1 <> 1
THEN
RETURN (FALSE);
/*ADVICE(15): This point cannot be reached (dead code) [123] */
/*ADVICE(15): This point cannot be reached (dead code) [123] */
/*ADVICE(15): This point cannot be reached (dead code) [123] */
ELSE
RETURN (TRUE);
END IF;
END;
/*ADVICE(22): END of program unit, package or type is not labeled [408] */