From 6be4a6ed005b2c617e764ea3f979c6995c3d66f3 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 5 Sep 2019 14:26:08 +0200 Subject: [PATCH] switch to counting ok_to_continue instead of current_blocks -- this still reflects structural problems or missing-rustification problems --- src/top_evil_rs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/top_evil_rs.py b/src/top_evil_rs.py index f7518e29f..a64c3f4b7 100755 --- a/src/top_evil_rs.py +++ b/src/top_evil_rs.py @@ -12,13 +12,13 @@ if __name__ == "__main__": s = re.sub(r"(?m)///.*$", "", s) # remove comments unsafe = s.count("unsafe") free = s.count("free(") - gotoblocks = s.count("current_block =") + gotoblocks = s.count("ok_to_continue") filestats.append((fn, unsafe, free, gotoblocks)) sum_unsafe, sum_free, sum_gotoblocks = 0, 0, 0 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_free += free sum_gotoblocks += gotoblocks @@ -27,5 +27,5 @@ if __name__ == "__main__": print() print("total unsafe:", sum_unsafe) print("total free:", sum_free) - print("total gotoblocks:", sum_gotoblocks) + print("total ok_to_continue:", sum_gotoblocks)