Table of Contents
What is CodeScene?
CodeScene is a powerful code analysis tool designed to help teams identify hotspots, manage technical debt, and improve development quality. With its seamless integration with Azure DevOps, CodeScene transforms raw data from your repositories into actionable insights, aligning code quality with business needs and team efficiency.
Who Benefits From CodeScene with Azure DevOps?
Stakeholders:
-
Developers: Quickly identify problematic areas in the codebase and track improvements over time.
-
Engineering Managers: Assess team contributions, detect delivery risks, and prioritize technical debt resolution.
-
CTOs: Align engineering efforts with business objectives by monitoring code health linked to strategic goals.
-
DevOps Teams: Automate code analysis as part of CI/CD pipelines for proactive quality assurance.
How to Enable CodeScene for Azure DevOps
1. Set Up a CodeScene Instance:
-
Docker Installation (Recommended):
Start the CodeScene container:docker run -d -it -p 3003:3003 \
--name codescene \
-v codescene:/codescene \
codescene/codesceneOnce the container is running, access CodeScene at http://localhost:3003 for a local installation or at the server's url and log in with your license credentials.
-
Standalone Installation:
Ensure Java 17+, Git, and SSH are installed. Run CodeScene as:java -jar codescene.standalone.jar
Access it via http://localhost:3003 for a local installation or at the server's url.
Configure Azure DevOps Authentication:
CodeScene requires access to Azure DevOps repositories:
-
RSA Keys :
-
Generate a RSA key inside the CodeScene Docker container:
docker exec -it -u codescene codescene ssh-keygen -q -t rsa -N '' -C "codescene" -f "/codescene/.ssh/id_rsa"
-
Add the public key to Azure DevOps under "SSH Public Keys" in User Settings.
docker exec -it -u codescene codescene ssh-keygen -y -t rsa -f "/codescene/.ssh/id_rsa"
-
Test that CodeScene can access your repository:
docker exec -it -u codescene codescene ssh -T git@ssh.dev.azure.com
-
Add Azure DevOps Repositories to CodeScene:
-
In CodeScene, create a new project and choose Specify Remotes.
-
Enter the SSH URL of the repository (e.g., git@ssh.dev.azure.com:organization/project/repo.git).
-
CodeScene will clone and analyze your repository using the provided credentials.
Frequently Asked Questions
Q: Does CodeScene support Azure DevOps cloud-hosted and on-premise repositories?
A: Yes, it supports both, provided the repository is accessible via SSH or HTTPS.
Q: Can I use CodeScene with GitHub Actions or another CI that integrates with Azure DevOps?
A: Absolutely! Use CodeScene’s REST API/webhooks to check code quality and halt deployments when issues are detected.
Q: How does CodeScene handle large Azure DevOps monorepos?
A: CodeScene is optimized to analyze large codebases by focusing on hotspots and areas with high team activity. You can configure it to only include selected subfolders.
Q: Can we track non-code changes (e.g., documentation)?
A: By default, CodeScene targets code files, but you can adjust rules in Project Configurations to include additional file types or exclude specific directories.
Leverage the powerful synergy between CodeScene and Azure DevOps to ensure your codebase is healthy and aligned with your business goals. With a few configuration steps, you’ll unlock valuable insights that elevate productivity and code quality!