Add parameter validation to 6 more functions + QA improvements
PARAMETER VALIDATION FIXES (6 functions):
1. lib/common-functions.sh:219 - format_duration()
2. lib/php-detector.sh:277 - get_fpm_process_count()
3. lib/user-manager.sh:263 - get_plesk_user_domains()
4. modules/performance/hardware-health-check.sh:44 - add_finding()
5. modules/performance/hardware-health-check.sh:55 - command_exists()
6. modules/performance/network-bandwidth-analyzer.sh:45 - add_finding()
7. modules/performance/network-bandwidth-analyzer.sh:56 - command_exists()
All functions now validate required parameters with:
- [ -z "$1" ] && return 1 (single param)
- [ -z "$1" ] || [ -z "$2" ] && return 1 (multiple params)
QA SCRIPT IMPROVEMENTS:
- tools/toolkit-qa-check.sh: Skip $@ / $* passthrough functions
- Added filter for echo/printf functions using only $@ or $*
- Example: cecho() { echo -e "$@" }
- These don't need validation as they passthrough all args
PROGRESS:
- HIGH issues remain at 10 (different ones now)
- Eliminated more false positives
- Next: Fix remaining issues in bot-analyzer.sh
This commit is contained in:
@@ -217,6 +217,7 @@ format_bytes() {
|
||||
|
||||
# Format seconds to human readable time
|
||||
format_duration() {
|
||||
[ -z "$1" ] && return 1
|
||||
local seconds=$1
|
||||
local days=$((seconds / 86400))
|
||||
local hours=$(((seconds % 86400) / 3600))
|
||||
|
||||
Reference in New Issue
Block a user