20 lines
543 B
Python
20 lines
543 B
Python
import gc
|
|
import json
|
|
|
|
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
|
|
plt.rcParams['figure.figsize'] = [18, 9]
|
|
plt.style.use('dark_background')
|
|
plt.subplots_adjust(left=0.05, right=0.99, top=0.95, bottom=0.05)
|
|
|
|
with open('metrics.json', 'r') as file:
|
|
entries = json.load(file)
|
|
|
|
units = []
|
|
for i, entry in entries:
|
|
units.append((i, entry["metrics"]["halstead"]["difficulty"] or 0.0, entry["metrics"]["halstead"]["bugs"] or 0.0))
|
|
X, Y, C = np.array(units).transpose()
|
|
plt.scatter(-X, Y, s=2.0, c=C)
|
|
plt.savefig('/code/metrics.png')
|