-
Notifications
You must be signed in to change notification settings - Fork 47
/
test_run.py
29 lines (24 loc) · 954 Bytes
/
test_run.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
26
27
28
29
import sys
from os import getcwd
from os.path import join
sys.path.append(join(getcwd(), "openunderstand"))
sys.path.append(join(getcwd(), "openunderstand", "oudb"))
sys.path.append(join(getcwd(), "openunderstand", "utils"))
sys.path.append(join(getcwd(), "openunderstand", "metrics"))
import openunderstand.ounderstand as und
_db = und.open("/home/y/Desktop/iust/OpenUnderstand/mydb.udb")
# und_all_results = {}
# for ent in _db.ents("Class"):
# ent_name = ent.name()
# print(ent.metric(["CountDeclMethodAll"]))
# all_methods = ent.metric(["CountDeclMethodAll"]).get("CountDeclMethodAll", 0)
# und_all_results[ent_name] = all_methods
und_all_results = {}
for ent in _db.ents("Class"):
ent_name = ent.name()
print(ent.metric(["CountDeclClassVariable"]))
all_methods = ent.metric(["CountDeclClassVariable"]).get(
"CountDeclClassVariable", 0
)
und_all_results[ent_name] = all_methods
print(und_all_results)