render.sh
This commit is contained in:
parent
c3b7fff4a8
commit
f4c9076ccc
@ -3,7 +3,7 @@ RUN cargo install rust-code-analysis-cli
|
|||||||
WORKDIR /code/
|
WORKDIR /code/
|
||||||
RUN git clone https://gitea.parrrate.ru/PTV/radn-rs.git
|
RUN git clone https://gitea.parrrate.ru/PTV/radn-rs.git
|
||||||
WORKDIR /code/radn-rs/
|
WORKDIR /code/radn-rs/
|
||||||
RUN git fetch && git checkout a89fd3416cb1eb9b0d34fc514d79cbf85b0e856a
|
RUN git fetch && git checkout e8142ba869bffa60d9a3a809d1c7e2093afd8ba5
|
||||||
COPY metrics.py /code/metrics.py
|
COPY metrics.py /code/metrics.py
|
||||||
RUN python3 /code/metrics.py
|
RUN python3 /code/metrics.py
|
||||||
FROM python:3.11
|
FROM python:3.11
|
||||||
|
@ -8,7 +8,7 @@ def filter_schema(obj, schema):
|
|||||||
return {key: filter_schema(obj[key], value) for key, value in schema.items()}
|
return {key: filter_schema(obj[key], value) for key, value in schema.items()}
|
||||||
|
|
||||||
|
|
||||||
entry_schema = {"metrics": {"halstead": {"bugs": True, "difficulty": True}}}
|
entry_schema = {"name": True, "metrics": {"halstead": {"bugs": True, "difficulty": True}}}
|
||||||
|
|
||||||
commits = check_output(['git', 'log', '--pretty=%H'], text=True).splitlines()
|
commits = check_output(['git', 'log', '--pretty=%H'], text=True).splitlines()
|
||||||
entries = []
|
entries = []
|
||||||
|
@ -13,7 +13,11 @@ with open('metrics.json', 'r') as file:
|
|||||||
|
|
||||||
units = []
|
units = []
|
||||||
for i, entry in entries:
|
for i, entry in entries:
|
||||||
units.append((i, entry["metrics"]["halstead"]["difficulty"] or 0.0, entry["metrics"]["halstead"]["bugs"] or 0.0))
|
x = i
|
||||||
|
y = entry["metrics"]["halstead"]["difficulty"] or 0.0
|
||||||
|
y += (hash(entry["name"]) % 201 - 100) / 500
|
||||||
|
c = entry["metrics"]["halstead"]["bugs"] or 0.0
|
||||||
|
units.append((x, y, c))
|
||||||
X, Y, C = np.array(units).transpose()
|
X, Y, C = np.array(units).transpose()
|
||||||
plt.scatter(-X, Y, s=2.0, c=C)
|
plt.scatter(-X, Y, s=2.0, c=C)
|
||||||
plt.savefig('/code/metrics.png')
|
plt.savefig('/code/metrics.png')
|
||||||
|
Loading…
Reference in New Issue
Block a user