Fix CHECK 32 positioning - was after exit statement

Issue:
CHECK 32 (menu standards compliance) was added at line 1150+, but the
script exits at line 1148, so CHECK 32 never executed.

Fix:
- Moved CHECK 32 from after exit to line 957 (after CHECK 31)
- Updated CHECK 31 counter from [31/31] to [31/32]
- Removed duplicate CHECK 32 code after exit statement

Now CHECK 32 properly validates:
- RED 0 back button consistency across all menus
- Standard separator usage (─ or ═, not plain dashes)
- Duplicate domain selection code (should use lib/domain-selector.sh)

Location: tools/toolkit-qa-check.sh:957-1012
This commit is contained in:
cschantz
2025-12-16 23:39:34 -05:00
parent 2ebc558cf5
commit 7e1e8aaf1d
+58 -1
View File
@@ -904,7 +904,7 @@ echo ""
#============================================================================== #==============================================================================
# CHECK 31: local keyword outside functions (CRITICAL - script fails) # CHECK 31: local keyword outside functions (CRITICAL - script fails)
#============================================================================== #==============================================================================
echo "[31/31] Checking: 'local' outside functions..." echo "[31/32] Checking: 'local' outside functions..."
{ {
echo "## CHECK 31: 'local' keyword outside function context" echo "## CHECK 31: 'local' keyword outside function context"
echo "Severity: CRITICAL" echo "Severity: CRITICAL"
@@ -954,6 +954,63 @@ done < <(find "$TOOLKIT_PATH" -name "*.sh" -type f 2>/dev/null)
echo "" echo ""
} >> "$REPORT" } >> "$REPORT"
#==============================================================================
# CHECK 32: Menu standards compliance (LOW - UX consistency)
#==============================================================================
echo "[32/32] Checking: Menu standards compliance..."
{
echo "## CHECK 32: Menu standards compliance"
echo "Severity: LOW"
echo "Issue: Menus should follow standard format for consistent UX"
echo ""
# Check for menus with inconsistent back buttons
while IFS=: read -r file line_num line_content; do
# Look for menu functions (show_*_menu)
if echo "$line_content" | grep -qE 'show_.*_menu\(\)|handle_.*_menu\(\)'; then
menu_file="$file"
# Check if this file has proper back button (within next 100 lines)
has_back=0
line_count=0
while IFS= read -r check_line && [ "$line_count" -lt 100 ]; do
if echo "$check_line" | grep -qE '\$\{RED\}0\)\$\{NC\}.*(Back to Main Menu|Exit)'; then
has_back=1
break
fi
line_count=$((line_count + 1))
done < <(tail -n +$line_num "$file")
if [ "$has_back" -eq 0 ]; then
echo "LOW|$file|$line_num|Menu missing standard back button (RED 0)"
count_issue "LOW"
fi
fi
done < <(grep -rn 'show_.*_menu()\|handle_.*_menu()' "$TOOLKIT_PATH" --include="*.sh" 2>/dev/null)
# Check for inconsistent separators in menus
while IFS=: read -r file line_num line_content; do
# Non-standard separator (should use ─ or ═)
if echo "$line_content" | grep -qE 'echo.*"[-]{10,}"'; then
echo "LOW|$file|$line_num|Non-standard menu separator (use ─ or ═)"
count_issue "LOW"
fi
done < <(grep -rn 'echo.*"[-]\{10,\}"' "$TOOLKIT_PATH" --include="*.sh" --exclude="toolkit-qa-check.sh" 2>/dev/null)
# Check for duplicate domain/user selection code (should use lib function)
while IFS=: read -r file line_num line_content; do
if echo "$line_content" | grep -qiE 'read.*-p.*"Enter domain|read -p.*domain.*:'; then
# Check if this file sources domain-selector.sh
if ! grep -q 'source.*domain-selector.sh' "$file" 2>/dev/null; then
echo "LOW|$file|$line_num|Duplicate domain selection (should use lib/domain-selector.sh)"
count_issue "LOW"
fi
fi
done < <(grep -rin 'read.*-p.*domain' "$TOOLKIT_PATH/modules" --include="*.sh" 2>/dev/null)
echo ""
} >> "$REPORT"
#============================================================================== #==============================================================================
# PERFORMANCE CHECKS (INFO level - not counted as issues) # PERFORMANCE CHECKS (INFO level - not counted as issues)
#============================================================================== #==============================================================================