There are several different types of software code metrics. The datasets I will be using contain three different types of code metrics, listed below. I will use a subset of each of the different types of code metrics, based on communal availability. This subset is listed in \fig{attribute-clustering-main}.
\bd
\item[Halstead] code metrics are static code metrics meaning that they can be calculated without running the program. The Halstead code metrics are calculated from the number of operators and operands used within the software.
\item[McCabe] code metrics are based on a concept called Cyclomatic Complexity. McCabe code metrics represent "a structured testing methodology known as basis path testing"\cite{mccabeMetrics}. These metrics are calculated by creating a graph representation of the software project being studied.
\item[Lines of Code / Miscellaneous] are code metrics that based off of frequency counts of various parts of the software. For example, the number of lines of comments, the number of possible branches in program flow, and the number of parameters are all included in this category.
\ed

The Halstead code metrics were developed by Maurice Halstead. He developed these metrics on the basis that hard to read code is hard to write defect free\cite{softwareScience}. He determined that the number of operators and operands defines the readability of the code. The Halstead code metrics are a combination of frequency counts and derived metrics. Four pieces of information about a module are recorded:
\bi
\item The number of Unique Operators
\item The number of Unique Operands
\item The total number of Operators
\item The total number of Operands
\ei
From these frequency counts, amongst others, the rest of the Halstead metrics are calculated.
%\input{tables/codemetrics}

The McCabe code metrics were created by Thomas McCabe. The approach to collecting these metrics differs from the Halstead metrics. The Halstead metrics are based on symbol counts, while the McCabe code metrics are based on the connections between these symbols. "Unlike Halstead, McCabe argued that the complexity of pathways between the symbols is more insightful than just a count of the symbols."\cite{06learnPredict} When calculating the McCabe code metrics, a directed graph representing a module is created. In this graph, a node represents a statement within the module, and each path represents a logical flow between two statements. The metrics are then calculated from this graph.

The miscellaneous lines of code category of code metrics are straightforward metrics such as the number of lines of code, the number of comments, the number of blank lines, etcetera. Another group of metrics were provided with the MDP datasets, and do not contain any documentation describing their usage or collection. I do not use the proprietary metrics provided in the MDP datasets because they are not provided in the SoftLab datasets I also use.
