-
Notifications
You must be signed in to change notification settings - Fork 0
/
techdebt
executable file
·45 lines (27 loc) · 1022 Bytes
/
techdebt
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python3
import argparse
import yaml
from src.lib import *
parser = argparse.ArgumentParser()
parser.add_argument("--conf", help="configuration", default="techdebt.yml")
args = parser.parse_args()
conf_file = args.conf
if os.path.isfile(conf_file):
with open(conf_file) as f:
options = yaml.load(f)
folders = options['folder']
excluded_folders = folders['excluded']
included_folders = folders['included']
extensions = options['extensions']
scores = options['scores']
if 'plugins' in options:
plugin_stats = get_debt_from_plugins(options['plugins'])
debts = analyse_debt(included_folders, extensions, excluded_folders)
debt_statistics = compute_debt_statistics(debts, scores)
print_stats(debt_statistics)
print('detail')
for debt in debts:
print("---debt: ", debt['file'], debt['line'], debt['debt_type'], debt['comment'])
plot_debt(debt_statistics)
else:
print('configuration file {} not found'.format(conf_file))