This is a tool for prioritizing code smells using developers' context. Note that this tool supports only class level code smells. Please refer to our publication for more details.
- Prepare the input files: code smell file and impact analysis file (see Input File Format).
- Use the following command to generate the result.
- The result will be generated as Result.csv (see Output File Format).
python CSP.py code_smell_file_name impact_analysis_file_name [alpha=1] [cut_point=40]
alpha = The combination ratio of CRI and Severity
cut_point = The maximum number of impact analysis results of each issue that are going to be considered
For the details, please refer to our publication.
python CSP.py Smells.csv IA.csv 1 40
Smell ID | Severity | Class Name | Package Name | Smell Type |
---|---|---|---|---|
1 | 7 | ClassA | com.package.ui | God |
2 | 8 | ClassB | com.package.model | Blob |
. | . | . | . | . |
Smell ID = A Unique ID of each smell
Severity = An integer representing the severity of each smell (e.g. 1-10)
Package Name = Package name of the class (in case there is folder name in front of it, the tool will automatically remove the folder name, e.g., src/java/com.package.ui → com.package.ui)
Example: Smells.csv
Issue ID | Class Full Name | Score |
---|---|---|
1001 | com.package.ui.ClassA | 0.321 |
1001 | com.package.model.ClassB | 0.211 |
. | . | . |
Please remove the header line of the file before using the tool (if any).
Example: IA.csv
Smell ID | Ranking | CRI | Severity | Class Name | Package Name |
---|---|---|---|---|---|
70 | 1.0 | 3.21 | 2 | com.package.ui | God |
25 | 0.9 | 2.13 | 3 | com.package.model | Blob |
. | . | . | . | . | . |
Ranking = A criterion used for prioritizing code smell generated by combining CRI and Severity.
CRI = Context Relevance Index
For the details on the calculation of Ranking and CRI, please refer to our publication.
Example: Result.csv
To be added