EntryPoints-EntriesByPath

Consider routines in given paths as externally called entry points

Required inputs: IR

This rule identifies additional entry points based on their source location and visibility.

This rule typically is used to easily add entry points from third-party libraries or other special locations. When used for C++ libraries like Qt, for example, you can select the Qt header paths and (depending on the visibility selection) all public methods declared there will be considered as entry points. Redefinitions of virtual functions selected in this way are also considered. Thus, your redefinitions of virtual Qt functions are also entry points, signalling the analysis that they might be called from outside the source code being analysed.

Configuration of entry points is required for dead code analysis and static semantic analysis.

Possible Messages

This rule has no predefined messages.

Options

The following places define options that affect this rule: Analysis-GlobalOptions

check_declarations_and_definition

check_declarations_and_definition : bool = False

For undefined routines, the routine is excluded if at least one declaration position matches. For defined routines, only the definition's position is checked against the path patterns if this option is False. Set this option to True to mark a defined function as entry point if either its definition or any of its declarations matches the path patterns.
 

paths

paths : set[bauhaus.analysis.config.FileGlobPattern] = set()

A set of path globbing patterns. All routines in paths matching at least one of those patterns are considered entry points.
 

visibility

visibility

Type: set[RoutineCategory]

Default: {'Non-static Function', 'Public Method'}

Restrict affected methods to those matching one of the selected visibilities, e.g. affect only public methods.
 

Option Types

These types are used by options listed above:

RoutineCategory

Routine categories for config options.
 
  • Static Function

  • Non-static Function

  • Public Method

  • Protected Method

  • Private Method

  • C# Internal Method

  • C# Protected Internal Method

  • C# Protected Private Method