Toad World® Forums

CodeXpert - why reports to declare VARIALBE as deep as possible?

CodeXpert reports me “Variable - Ensure item is defined in as deep a scope as possible” for “tperson” in the simple example below. Is this a bug and if yes, where can I open a bug issue?

{code}
CREATE OR REPLACE PACKAGE UNUSED_OBJECT_EXAMPLE
AS
TYPE tperson IS RECORD (
person_id T_PERSON.PERSON_ID%TYPE,
person_type T_PERSON.PERSON_TYPE%TYPE
);

PROCEDURE PROC_USE1 (in_person IN tperson);

PROCEDURE PROC_USE2;
END UNUSED_OBJECT_EXAMPLE;
/

CREATE OR REPLACE PACKAGE BODY UNUSED_OBJECT_EXAMPLE
AS
PROCEDURE PROC_USE1 (in_person IN tperson)
IS
BEGIN
IF in_person.person_id IS NOT NULL
THEN
NULL;
END IF;
END PROC_USE1;

PROCEDURE PROC_USE2
IS
person tperson;
BEGIN
person := NULL;
END PROC_USE2;
END UNUSED_OBJECT_EXAMPLE;
/
{code}

I am using Toad 9.7.2.5.

Thank you for your help …

Can anyone tell me if the above described problem still occurs the newest version (11.0) by using the provided code example?

Many thanks …

Just as the other example you posted (see my reply in that thread) this is a bug due to old CodeXpert code.

Thanks,
Andre

Hi Andre,

thanks for your feedback. It is, though, not clear for me if the above false positive is fixed in 11.5 or not?

Cheers,
Andreas