CODEX_ADK/BACKEND/code-review.sh
jean-philippe 5cd9702a81 feat: Code quality improvements and review infrastructure
Fixed all 13 code review issues achieving 100/100 quality score:
- Cache JsonSerializerOptions in GlobalExceptionHandler (CA1869)
- Convert constant arrays to static readonly fields (CA1861)
- Add code review infrastructure (Roslynator + SonarScanner)

Performance optimizations:
- Eliminated allocations in exception handling middleware
- Optimized validator array usage in commands
- Improved migration index creation efficiency

Code review tools:
- Added ./code-review-local.sh for local analysis
- Added Roslynator CLI configuration
- Added comprehensive code review guide

Cleanup:
- Removed outdated temporary documentation
- Updated .gitignore for code review artifacts
- Removed .DS_Store files

Build status:  0 errors, 0 warnings
Code analysis:  0 diagnostics found
Quality score: 100/100

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 19:26:44 -04:00

43 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# SonarScanner Code Review Script
# Usage: ./code-review.sh
set -e
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${GREEN}Starting SonarScanner Code Review...${NC}\n"
# Export dotnet tools to PATH
export PATH="$PATH:/Users/jean-philippe/.dotnet/tools"
# Clean previous build artifacts
echo -e "${YELLOW}Cleaning previous build...${NC}"
dotnet clean
# Begin SonarScanner analysis
echo -e "${YELLOW}Starting SonarScanner analysis...${NC}"
dotnet-sonarscanner begin \
/k:"codex-adk-backend" \
/n:"CODEX ADK Backend" \
/v:"1.0.0" \
/d:sonar.host.url="http://localhost:9000" \
/o:"codex" \
/d:sonar.verbose=false
# Build the solution
echo -e "${YELLOW}Building solution...${NC}"
dotnet build --no-incremental
# End SonarScanner analysis
echo -e "${YELLOW}Completing SonarScanner analysis...${NC}"
dotnet-sonarscanner end
echo -e "\n${GREEN}Code review complete!${NC}"
echo -e "${YELLOW}Note: For full SonarQube integration, install SonarQube server or use SonarCloud.${NC}"
echo -e "Visit: https://www.sonarsource.com/products/sonarqube/downloads/"