Locate_Similar_Record_Structures
This command locates record types that are identical to or have a high degree of commonality with other record structures in the program. A record type is identical to another record type if it contains exactly the same number of components and those components have exactly the same type marks. Component names are not considered. Similar record types have small differences in these two attributes.
Usage Tip: Identical record structures can sometimes be eliminated from the program, reducing redundancy and complexity. Similar record structures can sometimes be merged into a single discriminated record type.
Command-Line Interface
Locate_Similar_Record_Structures
-Maximum_Differences_Allowed [integer-expression, default = 1]
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/record_structure_analysis]
<list of units>Nonstandard Parameters
- Maximum_Differences_Allowed: Specifies the maximum number of differences that two record type declarations can have to be included in the report.
Sample Output
Record Cross-Reference
Component Cross-Reference
Comparison Tables
Locate_Specific_Coding_Violations
This command is not actually a separate command but a variant of the Locate_Coding_Violations command on page 128. The Locate_Coding_Violations command checks for standards-conformance violations enabled in the rule_enforcement file in the standards_conformance subdirectory of the current configuration policy. This command allows standards-conformance checks to be selected in the Boolean options section of the command dialog box.
Usage Tip: This command can be used to check for a specific subset of coding violations without having to modify the rule_enforcement file in the current configuration policy. Note also that it is possible to define custom dialog boxes with preselected combinations of options. This allows users to create there own sets of rules, still allowing the convenience of selection and deselection of rules when required. Consult the documentation on "Adding a New Dialog Box Definition" on page 261 for more information.
Command-Line Interface
Locate_Specific_Coding_Violations
-<rule enforcement name>
-Include_Allowed_Violations
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/specific_coding_violations_analysis]
<list of units>Nonstandard Parameters
- <rule enforcement name>: Specific rules can be enabled by listing their enforcement name (with the "Enforcement_For_" prefix removed) as an option. See "Standards-Conformance and Compatibility Rule Libraries" on page 299 for a list of enforcement names.
- Include_Allowed_Violations: Specifies whether violations in Ada units that are marked as allowed should be included in the hypertable output. It is possible to mark a violation as allowed by adding a comment of the form -- Allowed Rule Violation immediately before the declaration or statement that contains the violation. Other comments may also appear in the attached comment block. If this option is enabled, violations will appear in the output with an indication that they have been marked as allowed.
Locate_Ada95_Coding_Violations
This command is not actually a separate command but a variant of the Locate_Coding_Violations command on page 128. The Locate_Coding_Violations command checks for standards-conformance violations that are enabled in the rule_enforcement file in the standards_conformance subdirectory of the current configuration policy. This command allows standards-conformance checks (Ada 95 checks only) to be selected in the Boolean options section of the command dialog box.
Usage Tip: This command can be used to check for incompatibilities with Ada 95 without having to modify the rule_enforcement file in the current configuration policy.
Command-Line Interface
Locate_Specific_Coding_Violations
-<rule enforcement name>
-Include_Allowed_Violations
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/ada95_coding_violations_analysis]
<list of units>Nonstandard Parameters
- <rule enforcement name>: Specific Ada 95 rules can be enabled by listing their enforcement name (with the "Enforcement_For_" prefix removed) as an option. See "Standards-Conformance and Compatibility Rule Libraries" on page 299 for a list of enforcement names.
- Include_Allowed_Violations: Specifies whether violations in Ada units that are marked as allowed should be included in the hypertable output. It is possible to mark a violation as allowed by adding a comment of the form -- Allowed Rule Violation immediately before the declaration or statement that contains the violation. Other comments may also appear in the attached comment block. If this option is enabled, violations will appear in the output with an indication that they have been marked as allowed.
Locate_Statements
This command locates statements and collects general statement attributes.
Usage Tip: In some cases, compilers will generate more efficient code if constructs are used (or not used) in a particular way. Some projects prohibit the use of certain statements (such as goto) or have restrictions on use (the use of null statements, for example). This command can help locate all statements of a specific kind and display their attributes.
Command-Line Interface
Locate_Statements
-Include_Null_Statements
-Include_Assignment_Statements
-Include_Proc_Call_Statements
-Include_Exit_Statements
-Include_Return_Statements
-Include_Goto_Statements
-Include_Entry_Call_Statements
-Include_Delay_Statements
-Include_Abort_Statements
-Include_Raise_Statements
-Include_Code_Statements
-Include_If_Statements
-Include_Case_Statements
-Include_Loop_Statements
-Include_Block_Statements
-Include_Accept_Statements
-Include_Select_Statements
-Include_Asynchronous_Select_Statements
-Include_Requeue_Statements
-Include_Cond_Entry_Statements
-Include_Timed_Entry_Statements
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/statement_analysis]
<list of units>Nonstandard Parameters
- Include_*: Specifies whether to include the * kind of statement in the hypertable output.
Sample Output
Null Statements
Assignment Statements
Note: Tables for all other statement kinds contain attribute columns relevant to the description of that statement.
Locate_Static_Constraint_Violations
This command locates points where objects (for example, constants, variables, and parameters) are assigned static values that will always result in a Constraint_Error exception. If the constraints of the object and value expression do not match, they are reported by this command.
Usage Tip: The compilation system locates many static constraint violations but not all. Floating-point values and values that are computed from numeric expressions are not reported. This command will report these violations when the type bounds and assigned values are statically computable.
Command-Line Interface
Locate_Static_Constraint_Violations
-Include_String_Checking
-Include_Integer_Checking
-Include_Real_Checking
-Include_Array_Checking
-Include_Record_Component_Checking
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/static_constraint_violation_analysis]
<list of units>Nonstandard Parameters
- Include_*: Specifies whether to include the * kind of constraint checking in the hypertable output.
Sample Output
String Values
Integer Values
Real Values
Array Values
Record Component Selection
Locate_Subprogram_Complexities
This command locates all subprogram and task bodies that have high complexity. The following metrics are computed:
- Depth of statement nesting
- Depth of branching
- Number of source lines
- Number of execution paths
- Number of parameters
- Number of external variable references
- Number of calls to external subprograms
- Number of return statements in the subprogram body
A threshold parameter is available for several of the above attributes to limit which subprograms are included in the hypertable output.
Usage Tip: Complexity in subprograms is not inherently bad, but it can reduce readability and increase maintenance costs in the future. This command locates subprograms that exceed certain thresholds for inspection and possible modification.
Command-Line Interface
Locate_Subprogram_Complexities
-Minimum_Statement_Depth [integer-expression, default = 4]
-Minimum_Number_Of_External_Calls [integer-expression, default = 5]
-Minimum_Number_Of_External_Var_Refs [integer-expression, default = 5]
-Minimum_Number_Of_Procedure_Returns [integer-expression, default = 0]
-Minimum_Number_Of_Function_Returns [integer-expression, default = 1]
-Minimum_Number_Of_Execution_Paths [integer-expression, default = 5]
-And_Threshold_Values
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/subprogram_complexity_analysis]
<list of units>Nonstandard Parameters
- Minimum_Statement_Depth: Specifies the minimum depth to which statements can be nested to be included in the output.
- Minimum_Number_Of_External_Calls: Specifies the minimum number of calls to external subprograms to be included in the output.
- Minimum_Number_Of_External_Var_Refs: Specifies the minimum number of references to external variables (that is, not parameters or local variables) required to be included in the output.
- Minimum_Number_Of_Procedure_Returns: Specifies the minimum number of return statements required in a procedure to be included in the output.
- Minimum_Number_Of_Function_Returns: Specifies the minimum number of return statements required in a function to be included in the output.
- Minimum_Number_Of_Execution_Paths: Specifies the minimum number of separate execution paths required to be included in the output.
- And_Threshold_Values: Specifies that all thresholds must be met to be included in the output. The default requires that only one threshold be met to be included.
Sample Output
Locate_Subprograms_Propagating_Exceptions
This command locates all subprograms and the exceptions that are propagated from them. Subprograms that do not propagate any exceptions are also listed, with "None" as the name of the exception. A subprogram propagates an exception if:
- An exception is explicitly raised and not handled along the subprogram propagation path
- An exception is handled and then reraised with the raise statement
- A subprogram calls another subprogram that propagates an exception and the calling subprogram does not handle it
Usage Tip: The propagation of exceptions out of subprograms is an important part of a subprogram interface that cannot be documented explicitly in the Ada subprogram specification. Verifying which exceptions are propagated from subprograms can also be a code correctness issue.
Command-Line Interface
Locate_Subprograms_Propagating_Exceptions
-Include_Non_Visible_Subprograms
-Include_All_Raise_Points
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/propagation_analysis]
<list of units>Nonstandard Parameters
- Include_Non_Visible_Subprograms: Specifies whether to include subprograms that are not declared in a visible part.
- Include_All_Raise_Points: Specifies whether to include all raises that propagate out of each subprogram or whether to include only one entry for each distinct exception.
Sample Output
Locate_Subprogram_References
This command locates all data objects (for example, variables, constants, and parameters) that are referenced by a subprogram. Each referenced object is classified by its kind and context, and whether the program sets (writes) the object, uses (reads) it, or both.
Note: Since this analysis generates one table entry for each data object referenced, it is usually intended to be run over a limited number of program units.
Usage Tip: How subprograms use data is key in the design and implementation of most programs. Whether data is passed as a parameter, stored locally in the body of the package, or referenced globally from some other package can impact a program in many dimensions. This command provides an overview of all subprogram data access.
Command-Line Interface
Locate_Subprogram_References
-Sort_By_Subsystem
-Use_Configuration [string-expression, default = ""]
-To_Report_Named [string-expression, default =
<default_output_directory>/subprogram_data_reference_analysis]
<list of units>Nonstandard Parameters
All parameters are standard parameters.
Sample Output
References Sorted by Subprogram
References Sorted by Object
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2000, Rational Software Corporation. All rights reserved. |