mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 11:56:30 +03:00
switch to counting ok_to_continue instead of current_blocks -- this still reflects structural problems or missing-rustification problems
This commit is contained in:
@@ -12,13 +12,13 @@ if __name__ == "__main__":
|
|||||||
s = re.sub(r"(?m)///.*$", "", s) # remove comments
|
s = re.sub(r"(?m)///.*$", "", s) # remove comments
|
||||||
unsafe = s.count("unsafe")
|
unsafe = s.count("unsafe")
|
||||||
free = s.count("free(")
|
free = s.count("free(")
|
||||||
gotoblocks = s.count("current_block =")
|
gotoblocks = s.count("ok_to_continue")
|
||||||
filestats.append((fn, unsafe, free, gotoblocks))
|
filestats.append((fn, unsafe, free, gotoblocks))
|
||||||
|
|
||||||
sum_unsafe, sum_free, sum_gotoblocks = 0, 0, 0
|
sum_unsafe, sum_free, sum_gotoblocks = 0, 0, 0
|
||||||
|
|
||||||
for fn, unsafe, free, gotoblocks in reversed(sorted(filestats, key=lambda x: sum(x[1:]))):
|
for fn, unsafe, free, gotoblocks in reversed(sorted(filestats, key=lambda x: sum(x[1:]))):
|
||||||
print("{0: <30} unsafe: {1: >3} free: {2: >3} goto-blocks: {3: >3}".format(str(fn), unsafe, free, gotoblocks))
|
print("{0: <30} unsafe: {1: >3} free: {2: >3} ok_to_continue: {3: >3}".format(str(fn), unsafe, free, gotoblocks))
|
||||||
sum_unsafe += unsafe
|
sum_unsafe += unsafe
|
||||||
sum_free += free
|
sum_free += free
|
||||||
sum_gotoblocks += gotoblocks
|
sum_gotoblocks += gotoblocks
|
||||||
@@ -27,5 +27,5 @@ if __name__ == "__main__":
|
|||||||
print()
|
print()
|
||||||
print("total unsafe:", sum_unsafe)
|
print("total unsafe:", sum_unsafe)
|
||||||
print("total free:", sum_free)
|
print("total free:", sum_free)
|
||||||
print("total gotoblocks:", sum_gotoblocks)
|
print("total ok_to_continue:", sum_gotoblocks)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user