Code Inspections in Oracle
This topic lists all GoLand code inspections available in Oracle.
You can toggle specific inspections or change their severity level on the Editor | Inspections page of the IDE settings Control+Alt+S.
Forward declaration without definition
Reports declarations of procedures and functions that are missing their implementation in code.
In Oracle, you can declare a procedure or a function without its body, and write the implementation later. The inspection will report names of such procedures or functions that are left without implementation.
DECLARE PROCEDURE foo(a int, b varchar2); BEGIN NULL; END;
DECLARE PROCEDURE foo(a int, b varchar2); PROCEDURE foo(a int, b varchar2) IS BEGIN NULL; END; BEGIN NULL; END;
Missing body for package/object type specification
Reports package and object type specifications that are missing body declarations.
Package specifications and object types that declare routines as well as package specifications with cursors must have body declarations where those routines and cursors are implemented. Absence of a body leads to a runtime error when routines or cursors are invoked in program code.
CREATE OR REPLACE PACKAGE ppp IS FUNCTION foo(a INT) RETURN INT; END;
Reports invalid cases of subprogram overloading in Oracle.
DECLARE SUBTYPE fff IS BINARY_INTEGER; SUBTYPE ggg IS NATURAL; PROCEDURE foo (a IN ggg) IS BEGIN NULL; END; PROCEDURE foo (a IN fff) IS BEGIN NULL; END; BEGIN NULL; END;
You cannot overload subprograms which parameters differ only in subtypes. For example, you cannot overload procedures where one accepts a BINARY INTEGER parameter and the other accepts a NATURAL parameter. For more information about restrictions on procedure overloading, refer to Restrictions on Overloading at docs.oracle.com.