| name | code-analysis |
| description | Code analysis patterns. Grep commands for security, counting, architecture, performance. Loaded on demand. |
Skill: Code Analysis
Security scanning
grep -rn "password\|passwd\|secret\|api_key\|token\|credential" --include="*.py" --include="*.rb" --include="*.js" src/
grep -rn "cursor.execute\|\.raw(\|\.extra(\|RawSQL\|find_by_sql" --include="*.py" --include="*.rb" src/
grep -rn "mark_safe\|html_safe\|\.safe\|innerHTML" --include="*.py" --include="*.rb" --include="*.js" --include="*.html" src/
grep -rn "eval(\|exec(\|os.system\|subprocess" --include="*.py" --include="*.rb" --include="*.js" src/
Counting
find src/ -name "*.py" -o -name "*.rb" -o -name "*.js" | xargs wc -l | tail -1
find src/ -name "test_*" -o -name "*_test.*" -o -name "*_spec.*" | wc -l
grep -c "class.*Model\|class.*Base\|class.*Record" src/models*.py
Architecture
grep -rn "^import\|^from.*import\|require(" --include="*.py" --include="*.js" src/ | cut -d: -f1 | sort -u | wc -l
find src/ -type d | head -30
Large file reading
wc -l path/to/large_file.py
grep -n "class \|def " path/to/large_file.py | head -50
sed -n '100,150p' path/to/large_file.py