Skip to main content

Basic Usage

The most common way to use KafkaCode is with the scan command:

Scanning Your Project

Scan the current directory and all subdirectories:

Understanding the Output

Scan Summary

Every scan starts with a summary section:
Key Metrics:
  • Directory: Path that was scanned
  • Timestamp: When the scan was performed
  • Files Scanned: Number of source files analyzed
  • Total Issues: Count of all findings
  • Privacy Grade: Overall grade (A+ to F)

Issue Listings

Issues are grouped by severity:
Each finding includes:
  • File path: Location of the issue
  • Line number: Exact line where issue was found
  • Description: What was detected
  • Code snippet: The problematic code
  • Recommendation: How to fix it

Verbose Mode

Get detailed progress information during scanning:
Verbose output shows:
Verbose mode is helpful for:
  • Understanding what KafkaCode is doing
  • Debugging issues
  • Monitoring progress on large codebases

Exit Codes

KafkaCode uses exit codes to indicate results: Use in scripts:

Common Scenarios

Scenario 1: Quick Project Check

Scenario 2: Scan Before Commit

Scenario 3: Focus on Specific Directory

Scenario 4: Multiple Directory Scan

What Files Are Scanned?

Included Files

KafkaCode automatically scans these file types:

Python

*.py

JavaScript

*.js, *.jsx

TypeScript

*.ts, *.tsx

Java

*.java

Go

*.go

Ruby

*.rb

PHP

*.php

Excluded Files & Directories

Automatically skipped: Version Control:
  • .git/
  • .svn/
  • .hg/
Dependencies:
  • node_modules/
  • vendor/
  • bower_components/
Python Virtual Environments:
  • venv/
  • .venv/
  • env/
  • __pycache__/
  • .pytest_cache/
  • .mypy_cache/
Build Outputs:
  • build/
  • dist/
  • target/
  • out/
  • .next/
  • .nuxt/
Test Coverage:
  • coverage/
  • .coverage/
Plus any files/directories in your .gitignore

Gitignore Support

KafkaCode automatically respects your .gitignore file:
All matching files will be excluded from scanning.
Pro Tip: If you want KafkaCode to skip certain files, add them to your .gitignore. This is especially useful for test fixtures or mock data.

Performance Tips

Instead of scanning the entire project, target specific directories:
Add large directories to .gitignore:
Use time to measure performance:
Typical performance:
  • Small project (< 100 files): 2-5 seconds
  • Medium project (100-1000 files): 10-30 seconds
  • Large project (> 1000 files): 30-120 seconds

Interpreting Results

No Issues Found

Action: Great! Your code is clean. Continue following best practices.

Minor Issues Found

Action: Review and address minor issues when convenient.

Critical Issues Found

Action: Fix critical issues immediately before deploying!

Next Steps

CLI Options

Explore all command-line options

Interpreting Results

Learn to read and act on reports

CI/CD Integration

Automate scanning in your pipeline

Examples

See real-world usage examples
Important: KafkaCode is a static analysis tool. It may produce false positives or miss certain issues. Always review findings in context and use it as part of a comprehensive security strategy.