remove metrics.py
All checks were successful
buildbot/cargo clippy (1.65) Build done.
buildbot/cargo fmt (1.71) Build done.
buildbot/cargo test (1.65) Build done.
buildbot/cargo clippy (1.71) Build done.
buildbot/cargo doc (1.71) Build done.

This commit is contained in:
AF 2023-08-06 01:23:52 +00:00
parent df84129f2d
commit 69c7a1511e
2 changed files with 0 additions and 41 deletions

2
.gitignore vendored
View File

@ -2,5 +2,3 @@
/target /target
/Cargo.lock /Cargo.lock
**/*.rs.bk **/*.rs.bk
metrics.ansi
metrics.txt

View File

@ -1,39 +0,0 @@
import json
from subprocess import check_output
all_entries = []
def save_entry(entry: dict, prefix=""):
name = entry["name"] = prefix + entry["name"]
spaces = entry.pop("spaces")
all_entries.append(entry)
for space in spaces:
save_entry(space, f"{name}::")
def main():
lines = check_output(
["rust-code-analysis-cli", "-m", "-p", "src", "-O", "json"], text=True
).splitlines()
for line in lines:
entry = json.loads(line)
assert entry["kind"] == "unit"
assert entry["start_line"] == 1
assert entry["end_line"] >= entry["start_line"]
save_entry(entry)
all_entries.sort(
key=lambda entry: (
entry["metrics"]["halstead"]["bugs"] or 0,
entry["metrics"]["halstead"]["volume"],
),
reverse=True,
)
t = 0
for entry in all_entries:
if entry["kind"] == "unit":
t += entry["metrics"]["loc"]["ploc"]
print(t)
main()