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

1

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
2

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
3

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
4

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:

1

Project Discovery

~3 seconds

Identifies Python version, dependencies, and project structure

2

Code Quality Analysis

~8 seconds

Runs Pylint and Ruff for code style, complexity, and best practices

3

Security Scanning

~5 seconds

Uses Bandit to detect security vulnerabilities and common issues

4

Type Checking

~6 seconds

MyPy analysis for type safety and static type checking

5

Metrics & Reporting

~4 seconds

Generates 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:

$ ls -la

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:

$ merlin analyze . --exclude __pycache__,*.pyc,.pytest_cache,venv

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.