Skip to content

Commit

Permalink
Revert changes for metrics and fix report generation when no groups a…
Browse files Browse the repository at this point in the history
…re present
  • Loading branch information
Raleksan committed Oct 2, 2024
1 parent 99dd940 commit 5f7050d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions metrics/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,13 @@ class NotClassError(Exception):
if not (tree_class := list((value for value in tree))):
raise NotClassError('This is not a class')
with open(metrics, 'a', encoding='utf-8') as metric:
metric.write(f'NoOA {attrs(tree_class)} [CAM]'
metric.write(f'NoOA {attrs(tree_class)}'
f'Number of Non-Static (Object) Attributes\n')
metric.write(f'NoSA {sattrs(tree_class)} [CAMt]'
metric.write(f'NoSA {sattrs(tree_class)}'
f'Number of Static Attributes\n')
metric.write(f'NoCC {ctors(tree_class)} [CAMtt]'
metric.write(f'NoCC {ctors(tree_class)}'
f'Number of Class Constructors\n')
metric.write(f'NoOM {methods(tree_class)} [CAMttt]'
metric.write(f'NoOM {methods(tree_class)}'
f'Number of Non-Static (Object) Methods\n')
metric.write(f'NoCM {smethods(tree_class)} '
f'Number of Static (Class) Methods\n')
Expand Down
2 changes: 1 addition & 1 deletion steps/report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ st_list=${TARGET}/temp/structured-list-of-metrics.tex
rm -f "${st_list}"
touch "${st_list}"

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

0 comments on commit 5f7050d

Please sign in to comment.