Use the Scanner Tool
Using the Codebase Scanner
Section titled “Using the Codebase Scanner”Artiforge includes a powerful Scanner Tool that analyzes your entire codebase to identify code smells, performance bottlenecks, architectural issues, and quality concerns. This AI-powered analysis helps you maintain high code quality and catch potential problems before they become critical.
What Does the Scanner Tool Do?
Section titled “What Does the Scanner Tool Do?”The Scanner Tool provides comprehensive codebase analysis including:
- Code Smells Detection: Identifies anti-patterns, duplicated code, and poor design choices
- Performance Analysis: Detects potential bottlenecks and inefficient code patterns
- Architectural Issues: Finds structural problems and violations of architectural principles
- Quality Concerns: Highlights maintainability issues, technical debt, and best practice violations
- Security Issues: Identifies potential security vulnerabilities and unsafe patterns
Step 0: Use the Correct LLM Model
Section titled “Step 0: Use the Correct LLM Model”For best results, use a Thinking model such as Claude Sonnet/Opus 4. These models excel at code analysis and can provide deeper insights into complex codebases.
Step 1: Initiate the Conversation
Section titled “Step 1: Initiate the Conversation”Start a new chat session (Agent mode) in your preferred platform or interface where Artiforge is available.
Step 2: Use the Scanner Command
Section titled “Step 2: Use the Scanner Command”To activate Artiforge’s Scanner Tool, your message should be similar to:
use Artiforge tool to scan my codebase
You can also be more specific about what you want to analyze:
use Artiforge tool to scan my codebase for performance issues
or
use Artiforge tool to analyze my code for security vulnerabilities
Step 3: Provide Additional Context (Optional)
Section titled “Step 3: Provide Additional Context (Optional)”While the Scanner Tool can analyze your codebase automatically, providing additional context can help focus the analysis:
- Specific Concerns: Mention any known issues or areas of concern
- Recent Changes: Highlight recent refactoring or new features that need review
- Performance Bottlenecks: Point out specific components with performance problems
- Code Patterns: Specify particular patterns or anti-patterns you want to check for
Example:
use Artiforge tool to scan my codebase. I'm particularly concerned aboutthe authentication module's performance and want to check if there areany security issues in the API endpoints.
Understanding the Scanner Report
Section titled “Understanding the Scanner Report”After running the Scanner Tool, Artiforge generates a comprehensive report that includes:
Code Smells Section
Section titled “Code Smells Section”Lists problematic code patterns such as:
- Long methods or classes
- Duplicated code blocks
- God objects (classes doing too much)
- Shotgun surgery (changes requiring multiple file edits)
- Feature envy (excessive coupling between classes)
Performance Issues
Section titled “Performance Issues”Identifies bottlenecks including:
- Inefficient algorithms or data structures
- N+1 query problems
- Memory leaks or excessive allocations
- Synchronous operations that could be async
- Missing caching opportunities
Architectural Concerns
Section titled “Architectural Concerns”Highlights structural problems like:
- Circular dependencies
- Poor separation of concerns
- Tight coupling between modules
- Violations of SOLID principles
- Inconsistent architectural patterns
Quality Metrics
Section titled “Quality Metrics”Provides insights on:
- Code complexity (cyclomatic complexity)
- Test coverage gaps
- Documentation quality
- Dependency health
- Maintainability index
Acting on Scanner Results
Section titled “Acting on Scanner Results”The Scanner Tool doesn’t just identify problems—it provides actionable recommendations:
Priority Levels
Section titled “Priority Levels”Issues are categorized by severity:
- Critical: Immediate attention required (security vulnerabilities, major bugs)
- High: Should be addressed soon (performance bottlenecks, architectural flaws)
- Medium: Plan to fix in upcoming sprints (code smells, technical debt)
- Low: Nice to have improvements (minor style issues, optimizations)
Recommended Actions
Section titled “Recommended Actions”For each issue, the Scanner provides:
- Clear description of the problem
- Why it’s a concern
- Suggested fix or refactoring approach
- Code examples where applicable
- Links to relevant documentation or best practices
Best Practices for Using the Scanner
Section titled “Best Practices for Using the Scanner”Regular Scans
Section titled “Regular Scans”Run the Scanner Tool regularly to:
- Catch issues early before they accumulate
- Monitor code quality trends over time
- Validate that fixes actually resolve the problems
- Ensure new code meets quality standards
Focus Areas
Section titled “Focus Areas”Use the Scanner’s targeting capabilities to:
- Analyze specific modules or components
- Check new features before merging
- Validate refactoring efforts
- Review code from specific time periods
Integration with Workflow
Section titled “Integration with Workflow”Incorporate Scanner results into your development process:
- Run scans before major releases
- Use findings in code review discussions
- Track and prioritize technical debt
- Set quality gates based on Scanner metrics
Example Usage Scenarios
Section titled “Example Usage Scenarios”Scenario 1: Pre-Release Quality Check
Section titled “Scenario 1: Pre-Release Quality Check”use Artiforge tool to scan my codebase for any critical issuesbefore we release version 2.0
Scenario 2: Performance Optimization
Section titled “Scenario 2: Performance Optimization”use Artiforge tool to analyze my application for performancebottlenecks, especially in the data processing modules
Scenario 3: Security Audit
Section titled “Scenario 3: Security Audit”use Artiforge tool to scan my codebase for security vulnerabilitiesand unsafe coding patterns
Scenario 4: Technical Debt Assessment
Section titled “Scenario 4: Technical Debt Assessment”use Artiforge tool to analyze my codebase and identify areas withhigh technical debt that need refactoring
Tips for Better Results
Section titled “Tips for Better Results”- Be Specific: The more context you provide, the more targeted the analysis
- Run Incrementally: Scan specific modules or features rather than always scanning everything
- Track Progress: Keep scanner reports to monitor improvements over time
- Prioritize Fixes: Don’t try to fix everything at once—focus on critical and high-priority issues first
- Validate Fixes: Re-run the scanner after making changes to confirm issues are resolved
Next Steps
Section titled “Next Steps”After scanning your codebase, you can:
- Use Artiforge to help implement the recommended fixes
- Generate task plans for addressing identified issues
- Create documentation for architectural improvements
- Set up automated quality checks based on Scanner findings
The Scanner Tool is your partner in maintaining high code quality and building robust, maintainable applications.