Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

A Sample Measurement

Table 8-1 contains a summary of all the metrics used in this study, and the symbols denoting these metrics in the rest of the tables and figures.

Table 8-1. Selected metrics for the study

VariableMetric (symbol)
SizeSource Lines of Code (SLOC), Lines of Code (LOC)
 Number of C functions (FUNC)
ComplexityMcCabe’s cyclomatic complexity—maximum of all functions (MCYCLO)
 McCabe’s cyclomatic complexity—average (ACYCLO)
 Halstead’s length (HLENG), volume (HVOLUM), level (HLEVE), and mental discriminations (HMD)

The elements of code that provide input to all these metrics are illustrated in the sample source code file shown in Example 8-2. This file was extracted from the package urlgfe, a cross-platform download manager. (urlgfe has recently changed its name to uget, so it is no longer found in the ArchLinux repositories with its original name.) The file contains preprocessor directives (such as 1), comments (such as 3), and only one function (starting at line 4) containing a while loop.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint