 | For
each symbol in the database, Surveyor collects a number of attributes.
These attributes are specific to the type of symbol they describe.
Unless otherwise noted, the attribute data is collected and
updated by analyzing your source code.
Two groups of attributes play a significant role in quality
assurance processes. The file-based source checks point to specific,
potentially problematic lines in your code, and are shown in
the File Editor and Source Checks reports. The software metrics
are quantitative measurements of some aspect of your software,
and are typically viewed in the Metrics Tool and other display
windows.
General Symbol Attributes
| Kind |
Additional description of symbol type, such as initialized
or library. |
| Line Number |
Line in the source file where definition or declaration
of the symbol begins. |
| Scope |
Scope of the symbol, such as global or public. |
File-Based Source Checks
| Built-In Operators |
Indicates that the number of built-in operators in an
expression exceeds a user-specified threshold. |
| Conversion Issue |
Flags a conversion which could lose precision or rely
on non-portable interpretations of arithmetic or pointers.
This includes mixing of signed and unsigned operands when
it can lead to portability problems. Also includes right-shifts
of signed operands. |
| Functions in Expression |
Indicates that the number of function calls in an expression
exceeds a user-specified threshold. |
| Jump Statement |
Flags a goto, break or continue statement which makes
control flow more difficult to understand. |
| K&R Style Declarator |
Flags a function declarator that uses old style K&R
syntax, which is no longer valid in ANSI C or C++. |
| Missing Default Case |
Flags a switch statement which does not have a default
case. |
| Missing/Mismatched Decl |
Indicates an inconsistency between the declaration of
a function and the parameters used in a function call. This
is mostly effective for C, where prototypes are missing
or inconsistent. |
| Missing Return Type |
Flags a function declaration which does not specify the
return type. |
| Needs Compound Statement |
Flags a potentially missing compound statement (braces).
This includes possible errors caused by a dangling else
or by a statement mistakenly disassociated from a while
or for. |
| No Constructor |
Indicates that a class does not have a constructor. Best
practices recommend that explicit constructors always be
defined in order to avoid problems in initializing the class
objects. |
| Omitted Lines |
Flags a source line which is ignored by the analyzer due
to the current preprocessor settings. |
| Old Style Allocator |
Flags the use of old style memory allocators, such as
malloc, realloc, calloc or free, in a C++ program. |
| Potential Static Function |
Indicates that a function is only called from within the
file where it is defined, but is not declared static. |
| Problematic Constructor |
Flags a problematic definition in a class constructor.
This includes virtual function calls from the constructor
and initialization order problems. |
| Return Ignored |
Flags a statement which ignores the result of either a
function call or any other expression where the computation
is not stored. This typically indicates that error results
are being ignored. |
| Skipped Lines |
Flags a source line which is skipped due to syntax problems
that the analyzer cannot resolve. If the source compiles
in the original development environment, this could be an
indication of missing include files or incorrect configuration
of the analyzer. |
| Suspicious Assignment |
Flags a suspicious assignment in a conditional expression
or argument list, where the assignment might actually be
intended as a comparison. |
| Unclear Subexpression |
Flags a subexpression which is potentially not written
as intended. Examples are comparisons that can be statically
evaluated like unsigned variables and negative numbers.
Catches typical suspicious relational operator uses and
potential lack of parenthesis. |
| Unused Global Variable |
Indicates that a global variable is never used in the
source files loaded into the project. |
| Unused Local Variable |
Indicates that a local variable is never used. |
| Unused Static Variable |
Indicates that a static variable is never used. |
| Unterminated Case |
Flags a case in a switch statement which is not terminated
by an explicit transfer of control, such as a break statement.
|
| Variable Number of Args |
Flags a function which has a variable number of arguments.
|
File Level Metrics
| Comment Ratio |
Ratio of the lines of comments to the lines of source
code in the file. |
| Declarations in File |
Number of top-level declarations in the file, including
types, variables, functions and macro defines. |
| File Size (bytes) |
Size of the file, in bytes. |
| Halstead Intelligent Content |
Halstead language-independent measure of the amount of
content (complexity) of the file. |
| Halstead Mental Effort |
Halstead measure of the number of elemental mental discriminations
necessary to create, or understand, the file. |
| Halstead Program Difficulty |
Halstead measure of how compactly the file implements
its algorithms. This is the inverse of the Halstead Program
Level (of abstraction). |
| Included Files |
Number of header files in the project database which are
transitively included by the file. |
| Lines of Source Code |
Number of lines of statements in the file. Lines of Comments
Number of lines of comments in the file. |
| Source Quality Checks |
Number of source quality checks reported for the file.
|
| Total Lines |
Number of lines in the file. |
| Variables in File |
Number of variables and parameters in the file. For local
variables and parameters to be counted, data must be collected
with the -locals option enabled. |
Other File Level Attributes
| Modification Date |
Date that the file was last modified. |
| Owner |
Identifier of owner of the file. |
| Path |
Directory location of the file. |
| Permissions |
Read, write and execute permissions for the file. |
Class Level Metrics
| Attributes |
Number of attributes (member variables) of the class. |
| Class Coupling |
Measure of the coupling, or dependency, of the class.
Calculation is based on the number of inherited classes,
the number of nested classes, the number of calls to static
member functions, and the number of parameters and local
variables used by class member functions and having a class
type. To be accurate, data must be collected with the -locals
option enabled. The higher this value, the more effort is
required to understand, use and modify the class. |
| Derived Classes |
Depth of the hierarchy of derived classes of the class.
|
| Halstead Intelligent Content |
Halstead language-independent measure of the amount of
content (complexity) of the class. |
| Halstead Mental Effort |
Halstead measure of the number of elemental mental discriminations
necessary to create, or understand, the class. |
| Halstead Program Difficulty |
Halstead measure of how compactly the class implements
its algorithms. This is the inverse of the Halstead Program
Level (of abstraction). |
| Inheritance Hierarchy |
Depth of the hierarchy of base classes of the class. |
| Lack of Cohesion of Methods |
Measure of the cohesion of the member functions of the
class. Calculated as the ratio of methods (member functions)
which do not read or set a specific attribute (member variable),
averaged over all the attibutes of the class. |
| Local Methods |
Number of local methods (private member functions) of
the class. |
| Member Classes |
Number of nested classes (member classes) of the class.
|
| Member Types |
Number of member typedefs of the class. |
| Methods |
Number of methods (member functions) of the class. |
| Total Members of Class |
Total number of members of the class. |
Function Level Metrics
| Coverage |
Percentage of blocks of code that were executed (profile
data). |
| Cyclomatic Complexity |
McCabe measure of the cyclomatic complexity of the function.
This represents the number of linearly independent test
paths through the function. It also represents the number
of decision points in the function. The higher this number,
the more difficult the function is to understand and maintain.
|
| Fan In of Function Calls |
Number of functions in the source files loaded into the
project which call or read the function, either directly
or through function pointers. |
| Fan Out of Function Calls |
Number of functions which are called or read by the function,
either directly or through function pointers. |
| Frequency |
Number of times the function was called during execution
(profile data). |
| Halstead Intelligent Content |
Halstead language-independent measure of the amount of
content (complexity) of the function. |
| Halstead Mental Effort |
Halstead measure of the number of elemental mental discriminations
necessary to create, or understand, the function. |
| Halstead Program Difficulty |
Halstead measure of how compactly the function implements
its algorithms. This is the inverse of the Halstead Program
Level (of abstraction). |
| Lines in Function |
Number of lines in the function. |
| Statements in Function |
Number of lines of statements in the function. |
| Time |
Time spent executing the function (profile data). |
| Variables in Function |
Number of parameters and locals variables in the function.
To be accurate (non-zero), data must be collected with the
-locals option enabled. |
Variable Level Metrics
| Functions Reading |
Number of functions in the source files loaded into the
project which read the variable. |
| Functions Setting |
Number of functions in the source files loaded into the
project which set the variable. |
| Functions Using |
Number of functions in the source files loaded into the
project which read and/or set the variable. |
For more information on how Surveyor can help you solve your
development issues, click on one of the to the left.
|