Table of Contents
What is CodeScene?
CodeScene is an intelligent code analysis tool that helps teams improve code quality, reduce technical debt, and enhance development workflows. By integrating CodeScene with GitHub, teams can automatically analyze repositories, identify hotspots, and gain valuable insights to support decision-making.
Who Benefits From CodeScene with Azure DevOps?
Stakeholders:
-
Developers: Get insights into problematic code areas, refactoring recommendations, and team collaboration metrics.
-
Engineering Managers: Monitor code health, track risks, and ensure engineering efforts align with business goals.
-
CTOs & Tech Leads: Use data-driven analysis to optimize project roadmaps, reduce technical debt, and understand team dynamics.
-
DevOps Teams: Integrate CodeScene into GitHub Actions, enabling automated code reviews as part of CI/CD workflows.
How to Enable CodeScene for GitHub
Install CodeScene
Run CodeScene in Docker
docker run -d -it -p 3003:3003 \
--name codescene \
-v codescene:/codescene \
codescene/codescene
Once 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.
For Trial on-premise customers, we recommend using the script provided here when installing CodeScene
Authenticate CodeScene with GitHub
-
CodeScene needs access to your repositories in GitHub. Choose one of the following methods:
Option A: Authenticate Using a Personal Access Token (PAT)
-
Go to GitHub → Settings → Developer Settings → Personal Access Tokens.
-
Generate a new PAT with repo (read access) and admin:public_key permissions.
-
Use this PAT in CodeScene when specifying remote repositories.
Option B: Authenticate Using SSH Keys (Recommended for Security)
-
Generate an SSH key inside the CodeScene container:
docker exec -it -u codescene codescene ssh-keygen -q -t ed25519 -N '' -C "codescene" -f "/codescene/.ssh/id_ed25519"
-
Retrieve the public key:
docker exec -it -u codescene codescene ssh-keygen -y -t ed25519 -f "/codescene/.ssh/id_ed25519"
-
Add the Public Key to GitHub:
-
Navigate to GitHub → Settings → SSH & GPG Keys → New SSH Key.
-
Paste the generated key.
-
-
Validate Access:
docker exec -it -u codescene codescene ssh -T git@github.com
Add GitHub Repositories to CodeScene:
-
In CodeScene, create a new project.
-
Choose Specify Remotes and enter your GitHub repository URL in SSH format:
git@github.com:your-org/your-repo.git
-
CodeScene will automatically clone and analyze your GitHub repository.
Frequently Asked Questions
Can CodeScene analyze private GitHub repositories?
A: Yes, but you need to authenticate using SSH keys or a Personal Access Token (PAT).
Q: Does CodeScene work with GitHub Enterprise?
A: Yes! CodeScene integrates with GitHub Enterprise, whether it's cloud-hosted or on-premise.
Q: What happens if a repository is too large?
A: CodeScene focuses on high-churn areas, so it’s optimized for analyzing even large monorepos.
Q: Can CodeScene suggest refactoring strategies?
A: Yes! CodeScene identifies refactoring candidates, suggests maintainability improvements, and helps manage technical debt.
Leverage CodeScene's Full Potential with GitHub
By integrating CodeScene into your GitHub workflow, you ensure high code quality, risk-free releases, and better collaboration across teams. Set up automated code analysis, enforce coding standards, and optimize your development process with data-driven insights! 🚀