-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_dataframe.py
25 lines (23 loc) · 905 Bytes
/
plot_dataframe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from matplotlib import pyplot as plt
def plot_dataframe(dataframe):
"""
Plots the data for all files.
:param dataframe: The dataframe that contains all detected code smells.
"""
total_code_smells = {
'GL': dataframe['God Lines'].sum(),
'TMP': dataframe['Too Many Parameters'].sum(),
'IS': dataframe['Identifier Size'].sum(),
'FL': dataframe['Function Length'].sum(),
'LC': dataframe['Lazy Class'].sum(),
'FC': dataframe['Function Chains'].sum(),
'LGC': dataframe['Large Class'].sum(),
'DC': dataframe['Data Class'].sum(),
'MM': dataframe['Middle Man'].sum(),
'CC': dataframe['Cyclomatic Complexity'].sum()
}
plt.bar(total_code_smells.keys(), total_code_smells.values())
plt.ylabel('Count')
plt.xlabel('Code Smells')
plt.title('Number of Code Smells Detected')
plt.show()