Skip to content

Code Review Guidelines

This guide explains how to use Jake effectively for code reviews in your LabVIEW development process. Jake's review capabilities help you maintain high code quality by providing detailed analysis and specific recommendations for improvement.

Getting a Complete Review

Start your code review process with a comprehensive analysis of your VI. The review command provides detailed metrics and recommendations:

! @bd

Jake will analyze your code and provide: - A numerical quality score based on complexity, error handling, organization, and documentation - Specific strengths of your implementation - Areas that need attention - Performance analysis covering memory, CPU, and data flow impacts - Prioritized recommendations for improvement - Risk assessment if applicable

Focused Reviews

When you need to examine specific aspects of your code, you can focus Jake's review on particular areas:

! @bd Focus on error handling implementation
! @bd Analyze memory usage patterns
! @bd Review documentation completeness

Understanding Review Output

Jake's review command (!) provides structured output that helps you understand and improve your code:

Quality Scores:

### Score: 8/10
- Code complexity: 9/10 - Clear, straightforward implementation
- Error handling: 7/10 - Missing some error cases
- Organization: 8/10 - Good structure with minor improvements possible
- Documentation: 8/10 - Well documented with a few gaps

Performance Analysis:

## Performance Analysis
| Category | Impact | Details |
|----------|--------|---------|
| Memory   | 🟡     | Consider reducing data copies |
| CPU      | 🟢     | Efficient processing approach |
| Dataflow | 🟡     | Queue sizing could be optimized |

Implementing Improvements

After receiving review feedback, implement improvements systematically:

  1. First, address any high-priority items:

    ! @bd Review the critical issues identified
    

  2. Then tackle performance optimizations:

    ! @bd Verify performance improvements
    

  3. Finally, enhance documentation:

    ! @bd Check documentation coverage
    

Common Review Scenarios

Reviewing New Code:

! @bd This is new code ready for review

Jake will provide a fresh analysis focusing on code quality and adherence to best practices.

Reviewing Changes:

! @bd Review recent changes to this VI

Jake will analyze modifications and their impact on overall code quality.

Reviewing Error Handling:

! @bd Focus on error handling completeness

Jake will examine error handling paths and recovery mechanisms.

Review Best Practices

Regular Reviews: Make code reviews a regular part of your development process. Use Jake's review command frequently to catch issues early:

! @bd Quick review of current changes

Iterative Improvement: Address review findings iteratively, verifying improvements at each step:

! @bd Verify improvements after changes

Documentation Updates: Keep documentation current as you make improvements:

+ @bd Update documentation for modified sections

Understanding Risk Assessment

Jake's review output includes risk assessment when potential issues are identified:

## Risk Assessment
| Risk Level | Category | Description | Mitigation |
|------------|----------|-------------|------------|
| 🔴 High    | Memory   | Potential leak in loop | Implement proper cleanup |
| 🟡 Medium  | Error    | Missing error case | Add error handling |

Remember that effective code review is an ongoing process. Use Jake's review capabilities regularly to maintain high code quality and catch potential issues early in development.