Skip to content

Commit 5f7050d

Browse files
committed
Revert changes for metrics and fix report generation when no groups are present
1 parent 99dd940 commit 5f7050d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

metrics/ast.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,13 @@ class NotClassError(Exception):
457457
if not (tree_class := list((value for value in tree))):
458458
raise NotClassError('This is not a class')
459459
with open(metrics, 'a', encoding='utf-8') as metric:
460-
metric.write(f'NoOA {attrs(tree_class)} [CAM]'
460+
metric.write(f'NoOA {attrs(tree_class)}'
461461
f'Number of Non-Static (Object) Attributes\n')
462-
metric.write(f'NoSA {sattrs(tree_class)} [CAMt]'
462+
metric.write(f'NoSA {sattrs(tree_class)}'
463463
f'Number of Static Attributes\n')
464-
metric.write(f'NoCC {ctors(tree_class)} [CAMtt]'
464+
metric.write(f'NoCC {ctors(tree_class)}'
465465
f'Number of Class Constructors\n')
466-
metric.write(f'NoOM {methods(tree_class)} [CAMttt]'
466+
metric.write(f'NoOM {methods(tree_class)}'
467467
f'Number of Non-Static (Object) Methods\n')
468468
metric.write(f'NoCM {smethods(tree_class)} '
469469
f'Number of Static (Class) Methods\n')

steps/report.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ st_list=${TARGET}/temp/structured-list-of-metrics.tex
5252
rm -f "${st_list}"
5353
touch "${st_list}"
5454

55-
groups=($(grep -oP '\[.*?\]' "${list}" | sed 's/[][]//g') "")
55+
groups=($(grep -oP '\[.*?\]' "${list}" | sed 's/[][]//g' || : ) "")
5656
for group in "${groups[@]}"; do
5757
if [[ -z "$group" ]]; then
5858
echo "\item Ungrouped Metrics" >> "${st_list}"

0 commit comments

Comments
 (0)