Potential workaround for FortiClient issues#317
Conversation
| path.starts_with("/Library/Application Support/Fortinet/FortiClient/bin/") | ||
| && (path.ends_with("/ztnafw") || path.ends_with("/epctrl") || path.ends_with("/fctupdate")) |
There was a problem hiding this comment.
Final return uses a combined &&/|| expression; split into guard checks (check starts_with first, then return on ends_with cases) to clarify control flow.
Show fix
| path.starts_with("/Library/Application Support/Fortinet/FortiClient/bin/") | |
| && (path.ends_with("/ztnafw") || path.ends_with("/epctrl") || path.ends_with("/fctupdate")) | |
| if !path.starts_with("/Library/Application Support/Fortinet/FortiClient/bin/") { | |
| return false; | |
| } | |
| path.ends_with("/ztnafw") || path.ends_with("/epctrl") || path.ends_with("/fctupdate") |
Details
✨ AI Reasoning
The function computes 'matches_identifier' and uses early returns for several failure cases, but ends with a compound boolean return that mixes starts_with and multiple ends_with checks. This creates a moderately complex final condition that would be easier to read if split into explicit guard clauses (e.g., early-return false when the path doesn't start with the prefix, then check ends_with variants). The problematic expression increases cognitive load compared to simple guard-style checks.
Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
Summary by Aikido
⚡ Enhancements
More info