## 2 Background
### Maintainability Index Variants  
With extensive use of the Maintainability Index in software research and practice, the Index has been fine-tuned over time to better represent the maintainability characteristics of software systems, to ease the calculation, or to aid the interpretation of the results. This resulted in several defined variants of the Index. The key differences between the variants lie in the selection of the software metrics used and/or the amount of influence the selected software metrics have on maintainability. The original three-metric Maintainability Index (further referred to as \(Ml_{orig. }\)) proposed by [PERSON] and [PERSON] [8] is defined as:  
\[Ml_{orig.}=171-3.42\times\ln(aveE)-0.23\times aveV(g)-16.2\times\ln(aveLOC) \tag{1}\]  
where \(aveE\) is the average [PERSON]'s Effort per module, \(aveV(g)\) is the average Cyclomatic Complexity per module, and \(aveLOC\) is the average Lines of Code per module. Besides the three-metric Index that captures the size and complexity aspects of the code, [PERSON] and [PERSON] [8] proposed a four-metric Maintainability Index that additionally includes a self-explanatory aspect of the code. This was included in the equation by capturing the quantity of comments in the source code in a way that the presence of comments is considered to improve maintainability. The comment part of the equation first included the average Number of Lines of Comments per module. This metric was later criticizedas being too heavily skewed by large comment blocks, which has the potential to increase the value of the resulting Index excessively. Thus, to mitigate this thread of the Index being overly sensitive to comments, a more subtle Index variant was proposed using a ratio between comment lines and code lines instead of an absolute number of comment lines in the code [8; 9; 10]. The original four-metric Maintainability Index (\(MI_{orig. (CM)}\)) with the comment part, which limits the impact comments can have on maintainability, is calculated as  
\[MI_{orig.(CM)}=171-3.42\times\ln(aveE)-0.23\times aveV(g)-16.2\times\ln(aveLOC) \tag{2}\] \[+50\times\sin(\sqrt{2.4\times perCM})\]  
where \(aveE\) is the average Halstead's Effort per module, \(aveV(g)\) is the average Cyclomatic Complexity per module, \(aveLOC\) is the average Lines of Code per module, and the additional \(perCM\) is the average Percent of Lines of Comments per module. Due to criticisms regarding the non-monotonic nature of the Halstead's Effort metric, the Index was later reconstructed using Halstead's Volume metric instead since the difference between the two was not found to be statistically significant [9; 10]. This resulted in the improved three-metric Maintainability Index (\(MI_{impr. }\)) calculated as  
\[MI_{impr.}=171-5.2\times\ln(aveV)-0.23\times aveV(g)-16.2\times\ln(aveLOC) \tag{3}\]  
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. Again, the reconstructed Index was also proposed with the comment part [9; 10], resulting in the improved four-metric Maintainability Index (\(MI_{impr. (CM)}\)) defined as  
\[MI_{impr.(CM)}=171-5.2\times\ln(aveV)-0.23\times aveV(g)-16.2\times\ln(aveLOC) \tag{4}\] \[+50\times\sin(\sqrt{2.4\times perCM})\]  
where \(aveV\) is the average Halstead's Volume per module, \(aveV(g)\) is the average Cyclomatic Complexity per module, \(aveLOC\) is the average Lines of Code per module, and the additional \(perCM\) is the average Percent of Lines of Comments per module. A study by [PERSON] [60] revealed that there is a strong correlation between Lines of Code and Halstead's Volume, as well as between Lines of Code and Cyclomatic Complexity. Based on these findings, [PERSON] [11] substituted Halstead's Volume part and the Cyclomatic Complexity part in the Index equation with the respective calculations of these two parts using Lines of Code, which allows quicker and easier computation of the Index.