Skip to main content

Analyzing different branches

Repolyze allows you to analyze any branch of your repository, making it easy to compare feature branches, review pull requests, or track quality across development stages.

Switching branches

The branch selector is located in the analysis header, next to the repository name.
1

Open the branch selector

Click the branch button showing your current branch name. It displays a git branch icon and the active branch.
If the repository has only one branch, you’ll see a badge instead of a clickable selector.
2

Search for a branch

On desktop, a popover opens with a search field at the top. On mobile, a full-screen drawer appears for easier navigation.Type to filter branches by name. The search is case-insensitive and matches partial names.
3

Select a branch

Click on any branch to switch to it. The analysis will automatically refresh with data from the selected branch.
Branch items show additional metadata:
  • default badge for the repository’s default branch
  • Shield icon for protected branches
  • Checkmark for the currently selected branch

Branch selector features

Desktop experience

On screens wider than 640px, the branch selector uses a compact popover:
  • Compact Layout: Displays up to 10 branches before scrolling
  • Quick Access: Search field for fast filtering
  • Branch Count: Shows “X of Y branches” when more than 10 branches exist
  • Auto-focus: Search field activates on open

Mobile experience

On mobile devices, the selector provides a touch-optimized interface:
  • Full Drawer: Slides up from bottom covering 85% of screen height
  • Large Touch Targets: Bigger buttons (3.5× padding) for easier tapping
  • Fixed Header: Search stays accessible while scrolling
  • Branch Counter: Footer displays branch count when 5+ branches exist
The branch selector automatically adapts based on screen size using a media query at 640px (Tailwind’s sm breakpoint).Component: branch-selector.tsx (lines 160-370)Features include:
  • Responsive design with useMediaQuery hook
  • Keyboard navigation support
  • Touch gesture optimization
  • Scroll performance with overscroll-contain

Branch metadata

Each branch in the list includes important metadata:

Default branch indicator

The repository’s default branch (usually main or master) is marked with a default badge in primary colors.
{branch.isDefault && (
  <Badge variant="secondary" className="bg-primary/10 text-primary">
    default
  </Badge>
)}

Protected branch indicator

Protected branches display a shield icon in amber color, indicating they have branch protection rules enabled on GitHub.
{branch.protected && (
  <HugeiconsIcon icon={ShieldEnergyIcon} className="text-amber-500" />
)}

Branch information structure

Branch data includes:
interface BranchInfo {
  name: string;              // Branch name
  commit: {
    sha: string;             // Latest commit SHA
    url: string;             // GitHub commit URL
  };
  protected: boolean;        // Branch protection status
  isDefault: boolean;        // Default branch flag
}

Comparing branches

Use branch analysis to compare different stages of development:

Feature branches

Analyze feature branches before merging to ensure quality standards are met

Release candidates

Verify release branches have proper documentation and no security issues

Development vs. Production

Compare your dev branch against main to track quality improvements

Pull request review

Analyze PR branches to identify potential issues before code review

Branch analysis workflow

1

Analyze the default branch

Start with your repository’s default branch to establish a baseline quality score.
2

Switch to feature branch

Use the branch selector to analyze a feature branch or pull request.
3

Compare results

Note differences in:
  • Overall quality scores
  • Security vulnerabilities
  • Missing documentation
  • Code patterns and design issues
4

Address issues

Use the insights to improve your feature branch before merging.

Common use cases

Pre-merge quality checks

Before merging a pull request:
  1. Analyze the feature branch
  2. Check for:
    • Exposed secrets or security issues
    • Decreased test coverage
    • Missing documentation
    • Vulnerable dependencies
  3. Address any issues before merging

Release preparation

When preparing a release:
  1. Switch to the release branch
  2. Verify:
    • CHANGELOG is updated
    • README reflects new features
    • All tests are present
    • No security vulnerabilities
  3. Export a PDF report for release notes

Refactoring tracking

Track improvements during refactoring:
  1. Analyze before starting refactoring
  2. Note the initial quality scores
  3. Analyze after refactoring
  4. Compare scores to measure improvement
Pro tip: Take screenshots of scores before and after major changes to track quality improvements over time.

Troubleshooting

If a branch doesn’t appear in the selector:
  • Ensure the branch exists on the remote repository
  • Check that you have access to the repository
  • Try refreshing the analysis
  • Verify the branch hasn’t been deleted
If the analysis seems outdated:
  • Wait a few seconds for the analysis to complete
  • Check your network connection
  • Refresh the page
  • Clear browser cache if issues persist
Search issues:
  • Search is case-insensitive
  • Partial matches are supported
  • Special characters in branch names may affect search
  • Try searching with different terms

Next steps

Understanding Scores

Learn how quality scores are calculated for each branch

Exporting Reports

Export branch analysis results as PDF or markdown

Build docs developers (and LLMs) love