If you right-click a class and select Ports, the following options are available:
Using this show/hide functionality with the Show New Ports display option for the owning class, you can show and hide ports as intended to simplify your model. For more information about display options for classes, see Removing or deleting a class.
If you set Show New Ports mode to on, each new port that is added to the class is also displayed in the diagram class. Ports created before this graphic class, or while the Show New Ports feature is off, are not synthesized in the diagram, unless they were created using the graphic editor New Port option.
If Show New Ports mode is off, any ports created after disabling this mode are not displayed.