Track what really matters to you and your team.

code insights

Transform your code into a queryable database to create customizable, visual dashboards in seconds.

Finally, useful engineering metrics you define.

Forget about inaccurate spreadsheets, manual processes, and missing historical data. You can track everything in your codebase, from migrations to code smells, in a seamless and precise way. Make data-driven decisions using visualizations based on the power and accuracy of Sourcegraph Code Search.

Trusted by engineering teams worldwide

As we've grown, so has the need to better track and communicate our progress and goals across the engineering team and broader company. With Code Insights, our data and migration tracking is accurate across our entire codebase, and our engineers and managers can shift out of manual spreadsheets and spend more time working on code.
Balázs Tóthfalussy, Engineering Manager, Prezi
Prezi logo

Engineering leadership with superpowers

Code Insights provides reliable real-time reporting directly from the codebase, making engineering leaders and their teams more effective.

Set goals

Measure goals and progress in your codebase

Plan proactively

Stay on top of engineering initiatives and catch issues before they escalate

Track ownership & trends

Tie trends and metrics to owners on the teams

Celebrate progress

Visualize the momentum and motivate your teammates

How engineering teams use Code Insights

Migration to CSS modules

  • CSS Modulestype:file lang:scss file:module.scss patterntype:regexp archived:no fork:no
  • Global CSStype:file lang:scss -file:module.scss patterntype:regexp archived:no fork:no

Alpine versions over all repos

All repositories
  • 3.1
  • 3.5
  • 3.15
  • 3.8
  • 3.9
  • 3.9.2
  • 3.14
patterntype:regexp FROM\s+alpine:([\d\.]+) file:Dockerfile

Log4j incident response

  • Updated log4jlang:gradle org\.apache\.logging\.log4j[\'"] 2\.(17)(\.[0-9]+) patterntype:regexp archived:no fork:no
  • Vulnerable log4jlang:gradle org\.apache\.logging\.log4j[\'"] 2\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16)(\.[0-9]+) patterntype:regexp archived:no fork:no

Deprecated API usage by team

All repositories
  • CloudproblemAPI file:CloudDirectory archived:no fork:no
  • Core AppproblemAPI file:CoreDirectory archived:no fork:no
  • ExtensibilityproblemAPI file:ExtnDirectory archived:no fork:no

Linter override rules in all repos

All repositories
  • Linter overridesfile:\.eslintignore .\n patternType:regexp archived:no fork:no

# of repos connected to the CI system

All repositories
  • Connected reposfile:\.circleci/config.yml select:repo archived:no fork:no

See Code Insights in action

Popular Code Insights templates

Version Tracking
Code Health
Global CSS to CSS modules

Track migration from global CSS to CSS modules.

select:file lang:SCSS file:module patterntype:regexp archived:no fork:no
type:file lang:scss-file:module patterntype:regexp archived:no fork:no
Python 2 to Python 3

How far along is the Python major version migration?

#!/usr/bin/env python3 archived:no fork:no
#!/usr/bin/env python2 archived:no fork:no
React Class to Function Components

What's the status of migrating to React function components from class components?

patterntype:regexp const\s\w+:\s(React\.)?FunctionComponent archived:no fork:no
patterntype:regexp extends\s(React\.)?(Pure)?Component archived:no fork:no
Config or docs file

How many repos contain a config or docs file in a specific directory?

select:repo file:docs/*/new_config_filename archived:no fork:no
Java versions

Detect and track which Java versions are present or most popular in your code base.

<java.version>(.*)</java.version> archived:no fork:no
All log4j versions

Which log4j versions are present, including vulnerable versions?

lang:gradle org\.apache\.logging\.log4j['"] 2\.([0-9]+)\. archived:no fork:no
License types in the codebase

See the breakdown of licenses from package.json files.

file:package.json "license":\s"(.*)" archived:no fork:no
Python versions

Which python versions are in use or haven't been updated?

#!/usr/bin/env python([0-9]\.[0-9]+) archived:no fork:no
Vulnerable open source library

Confirm that a vulnerable open source library has been fully removed, or the speed of the deprecation.

[email protected] archived:no fork:no
How many tests are skipped

See how many tests have skip conditions.

this.skip() patterntype:literal archived:no fork:no
Vulnerable log4j versions

What vulnerable log4j versions are present?

lang:gradle org\.apache\.logging\.log4j['"] 2\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16)(\.[0-9]+) patterntype:regexp archived:no fork:no
API keys

How quickly do we notice and remove API keys when they are committed?

regexMatchingAPIKey patterntype:regexp archived:no fork:no

How many TODOs are in a specific part of the codebase (or all of it)?

TODO archived:no fork:no
Commits with "revert"

How frequently are there commits with “revert” in the commit message?

type:commit revert archived:no fork:no
Linter override rules

How many linter override rules exist?

file:\.eslintignore .\n patterntype:regexp archived:no fork:no
Deprecated calls

How many times are deprecated calls used?

lang:java @deprecated archived:no fork:no

Popular Code Insights templates

Version Tracking
Code Health

Get started with Code Insights

Create a code insight in 60 seconds and get historical data for previously untracked metrics — data backfills automatically.

Learn More

Blog post

How we migrated entirely to CSS Modules using codemods and Sourcegraph Code Insights

How our Frontend Platform team used codemods to automate a challenging global migration to CSS modules, and Code Insights to track and communicate progress.

Migrating to CSS modules with codemods and code insights blog thumbnail

5 key traits of a code intelligence platform

Sourcegraph is more than search. Learn how the code intelligence platform helps development teams quickly get unblocked, resolve issues faster, and gain insights to make better decisions.

Grid background with abstract blue and pink hues

Dive into documentation

Learn everything you need to know about Code Insights.

Code insights documentation thumbnail