Multiple packages in the same file have multiple references can cause agility issues

Software AgilityCode Readability

Why you should care

A package is a schema object that groups logically related PL/SQL types, variables, and subprograms. They usually have a specification (spec) and a body. The spec is the package’s interface which declares the types, variables, constants, exceptions, cursors, and subprograms which are referenced from outside the package. Although the body tends to be unnecessary it defines queries for the cursors and code for the subprograms. Their advantages lie in Modularity, Easier application design, Information hiding, Added functionality, and better performance.

Avoid several packages in the same file because it requires Oracle to recompile every stored program that references the packages. As a result, multiple packages are referenced causing agility issues and possible bug entry.

Business Impacts

Adding several packages in the same file can be seen as efficient but is actually a costly endevour that can hamper the code’s agility.


CAST Recommendations


Style Guide

How we detect

This code insights shows that several packages should be avoided in the same file.


About CAST and Highlight’s Code Insights

Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.

See featuresHow it works