## 2 Background
### Maintainability Index Variants
The author built upon the improved Index and proposed the Maintainability Index computed using only Lines of Code (\(MI_{LOC}\)) as follows:  
\[MI_{LOC}=171-5.2\times\ln(45\times aveLOC-428)-0.23\times(0.22 \times aveLOC-1.9) \tag{5}\] \[-16.2\times\ln(aveLOC)\]  
where \(aveLOC\) is the average Lines of Code per module. The JHawk product introduced two additional Index variations that use the Number of Statement metric instead of the Lines of Code metric. The former is believed to be a better measure of software size than the latter [13]. Thus, the JHawk three-metric Maintainability Index (\(MI_{JH}\)) is calculated as  
\[MI_{JH}=171-5.2\times\ln(aveV)-0.23\times aveV(g)-16.2\times\ln(aveNOS) \tag{6}\]  
where \(aveV\) is the average Halstead's Volume per module, \(aveV(g)\) is the average Cyclomatic Complexity per module, and the substituted \(aveNOS\) is the average Number of Statementsper module. Again, the Index was also defined with the comment part, resulting in the JHawk four-metric Maintainability Index (\(Ml_{JH(CM)}\)) as follows:  
\[ \begin{split} MI_{JH(CM)}=171-5.2\times\ln(aveV)-0.23\times aveV(g)- 16.2\times\ln(aveNOS)\\ +50\times\sin(\sqrt{2.4\times perCM})\end{split}  \tag{7}\]  
where \(aveV\) is the average Halstead's Volume per module, \(aveV(g)\) is the average Cyclomatic Complexity per module, \(aveNOS\) is the average Number of Statements per module, and \(perCM\) is the average Percent of Lines of Comments per module. The results of the presented Indices range from an unbounded negative number to 171. For the result of the Index to be bound between 0 and 100, which provides a clearer and more useful interpretation, Visual Studio derived an Index variant based on the improved Index with the sole difference of using a shifted scale [61]. The Maintainability Index defined by Visual Studio (\(MI_{VS}\)) is calculated as  
\[MI_{VS}=max\bigg{(}0,100\frac{171-5.2\times\ln(aveV)-0.23\times aveV(g)-16.2 \times\ln(aveLOC)}{171}\bigg{)} \tag{8}\]  
where \(aveV\) is the average Halstead's Volume per module, \(aveV(g)\) is the average Cyclomatic Complexity per module, and \(aveLOC\) is the average Lines of Code per module. Each of the presented variants represents a slightly different approach to measuring maintainability by capturing different software-related characteristics. Table 1 provides a summary of the software metrics required to compute each variant and the corresponding software aspects that these metrics measure. As for measuring code complexity, both [PERSON]'s Effort and Halstead's Volume measure computational complexity, while [PERSON]'s Cyclomatic Complexity measures logical complexity. Lines of Code and Number of Statements measure software size. Percent of Lines of Comments measures the self-explanatory nature of the code base through documentation, i.e., code comments. Besides the above-presented Index variants, several others were proposed in the literature incorporating other software metrics that measure additional software aspects, e.g., cohesion and coupling; yet, they are not widely used. [PERSON] [16] proposed the Index based on design/code-level metrics, including the average Method Size, Program Length, Control Density, Depth of Inheritance Tree, and Method Hiding Factor. [PERSON] and [PERSON] [14] proposed the Index using package metrics, namely size, complexity, cohesion, and nesting metrics. [PERSON] et al. [15] proposed two Indices based on object-oriented metrics, such as Lack of Cohesion in Methods, Message Passing Coupling, Response for a Class, Weighted Method per Class, Number of Commands, Number of Constructors, and Number of Cyclic