Improve CHECK 32 menu detection accuracy

Issues Fixed:
1. Pattern too strict - only accepted "Back to Main Menu|Exit"
   Now accepts any "Back" or "Exit" text (e.g., "Back to Backup Menu")

2. False positives on handle_*_menu() functions
   These are event handlers, not menu display functions
   Now only checks show_*_menu() functions

Changes:
- Relaxed pattern: (Back to Main Menu|Exit) → (Back|Exit)
- Removed handle_.*_menu() from detection (handlers don't display menus)
- Updated grep to only find show_.*_menu() functions

Result: Fewer false positives, catches real menu standard issues
This commit is contained in:
cschantz
2025-12-17 00:58:07 -05:00
parent 586b51c7af
commit cbe274b7d6
+4 -4
View File
@@ -966,15 +966,15 @@ echo ""
# Check for menus with inconsistent back buttons # Check for menus with inconsistent back buttons
while IFS=: read -r file line_num line_content; do while IFS=: read -r file line_num line_content; do
# Look for menu functions (show_*_menu) # Look for menu display functions (show_*_menu only, not handle_*_menu handlers)
if echo "$line_content" | grep -qE 'show_.*_menu\(\)|handle_.*_menu\(\)'; then if echo "$line_content" | grep -qE 'show_.*_menu\(\)'; then
menu_file="$file" menu_file="$file"
# Check if this file has proper back button (within next 100 lines) # Check if this file has proper back button (within next 100 lines)
has_back=0 has_back=0
line_count=0 line_count=0
while IFS= read -r check_line && [ "$line_count" -lt 100 ]; do 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 if echo "$check_line" | grep -qE '\$\{RED\}0\)\$\{NC\}.*(Back|Exit)'; then
has_back=1 has_back=1
break break
fi fi
@@ -986,7 +986,7 @@ while IFS=: read -r file line_num line_content; do
count_issue "LOW" count_issue "LOW"
fi fi
fi fi
done < <(grep -rn 'show_.*_menu()\|handle_.*_menu()' "$TOOLKIT_PATH" --include="*.sh" 2>/dev/null) done < <(grep -rn 'show_.*_menu()' "$TOOLKIT_PATH" --include="*.sh" 2>/dev/null)
# Check for inconsistent separators in menus # Check for inconsistent separators in menus
while IFS=: read -r file line_num line_content; do while IFS=: read -r file line_num line_content; do