6.2.5.53. Architecture-ActivateMembers¶
Add members to the entries view if they and their parent types satisfy specific rules
Required inputs: CSharpAST, RFG
This analysis adds nodes to the entries view: for each pair (P1, P2) in the list activate_patterns, P1(code_view, node) will be evaluated for each node in code_view; if True is returned, for every child child_node (also indirect ones and including node itself), P2(code_view, child_node) is evaluated; if it evaluates to True, child_node is added to entries_view.
The analysis also adds constructors of each type T to the entries view if there is a tuple (method_name, generic_arg_count, activated_arguments) in register_call_patterns for which there is an invocation of a method named method_name, with generic_arg_count many generic arguments, and T being a generic argument at one of the positions in activated_arguments.
E.g.: if ("Activate", 2, [0]) is a tuple in register_call_patterns, a call Activate
Additionally, all constructors of all types that inherit from the type given in alive_type_name are added to the entries view.
Possible Messages
This rule has no predefined messages.
Options¶
This rule shares the following common options: exclude_messages_in_system_headers, excludes, includes, justification_checker, post_processing, provider, severity
The following places define options that affect this rule: Analysis-GlobalOptions
activate_patterns¶
activate_patterns
List of pairs of predicates (View X Node)->Bool; if the first predicate of a pair evaluates to True for a node in the code view, all children of the node (including the node itself) for which the second predicate evaluates to True are added to the entries view. The first argument of the predicate is always the code view.Type: list[typing.Tuple[typing.Callable[[_dg.View, _dg.Node], bool], typing.Callable[[_dg.View, _dg.Node], bool]]]
Default:
[(<function bauhaus.rules.axivion.csharp.activate_members.<lambda>(view, node)>, <function bauhaus.rules.axivion.csharp.activate_members.<lambda>(view, node)>)]
alive_type¶
alive_type : str = ''
code_view_name¶
code_view_name : str = 'Code Facts'
entries_view_name¶
entries_view_name : str = 'Entries'
export_warnings¶
export_warnings : bool = True
loglevel¶
loglevel : LogLevel = 'WARNING'
register_call_patterns¶
register_call_patterns : list[typing.Tuple[str, int, typing.List[int]]] = []
Option Types¶
These types are used by options listed above:
LogLevel¶
An enumeration.WARNING
INFO
DEBUG