Your First Analysis
Complete walkthrough to run your first Python code analysis with Merlin CLI. Learn quality metrics, security scanning, and architectural insights.
Before You Start
Prerequisites
- Merlin CLI installed and accessible in your PATH
- A code project ready for analysis
- 5-10 minutes of time for your first run
Don't have Merlin installed yet? Check out our installation guide.
Quick Start (3 Commands)
# Navigate to your Python project directory cd /path/to/your/python/project # Or use current directory pwd
That's it!
These commands will give you comprehensive Python code analysis. The process typically takes 20-30 seconds depending on project size.
Detailed Walkthrough
Choose Your Project
Select a Python codebase you'd like to analyze. Merlin specializes in Python projects and provides comprehensive analysis using Pylint, Ruff, Bandit, and MyPy.
Tips:
- Start with a small to medium-sized project (< 10,000 files)
- Ensure you have read permissions for all project files
- Git repositories work best for comprehensive analysis
Run Your First Analysis
Execute the analyze command with verbose output to understand what Merlin is doing behind the scenes.
Tips:
- The --verbose flag helps you learn what's being analyzed
- First runs may take longer as Merlin builds its cache
- Large projects (> 50MB) may require increased timeout
Understanding the Output
Merlin provides multiple sections of analysis results, from security findings to performance recommendations.
Tips:
- Focus on the overall score first, then dive into specific areas
- Red flags indicate critical issues that should be addressed
- Green checkmarks show areas where your code excels
Acting on Results
Use the insights to improve your codebase. Merlin provides actionable recommendations with specific file references.
Tips:
- Start with security issues (highest priority)
- Performance optimizations often have the biggest impact
- Architecture suggestions help long-term maintainability
What to Expect
Merlin analysis runs through five main phases. Here's what happens during each phase:
Project Discovery
~3 secondsIdentifies Python version, dependencies, and project structure
Code Quality Analysis
~8 secondsRuns Pylint and Ruff for code style, complexity, and best practices
Security Scanning
~5 secondsUses Bandit to detect security vulnerabilities and common issues
Type Checking
~6 secondsMyPy analysis for type safety and static type checking
Metrics & Reporting
~4 secondsGenerates quality metrics, scores, and actionable recommendations
Total Analysis Time
Most Python projects complete analysis in 20-30 seconds. Larger projects (>50MB) may take 1-2 minutes for the first run, but subsequent runs are much faster thanks to intelligent caching.
Common First-Run Issues
Permission Errors
If you see permission errors, ensure Merlin can read your project files:
Make sure the files aren't owned by root or another user.
Out of Memory
For very large Python projects, you might need to exclude certain directories:
Slow Analysis
First runs are slower. Speed up analysis by using --cache for subsequent runs or --tools ruff for faster linting-only analysis.
What's Next?
Now that you've run your first analysis, explore advanced features and learn how to integrate Merlin into your development workflow.