Introducing Code Scans | Devin


Today we’re introducing Code Scans: a brand new method to flip broad engineering objectives into concrete enhancements throughout your codebase. Tell Devin what you need to obtain, and it helps you examine what wants to vary, consider the findings, and switch them into pull requests.

Many engineering duties begin with a selected change. Others begin with an consequence:

  • Improve website positioning
  • Reduce upkeep overhead
  • Make your utility compile quicker

These objectives typically keep on the backlog as a result of step one alone is a considerable venture: investigating the codebase to determine the place to start out. Additionally, figuring out the alternatives is barely half the work — somebody nonetheless has to implement the modifications, and lots of of them.

Code Scans helps with each.

Powered by Agentic MapReduce, the structure we constructed for Devin Security Swarm, Code Scans breaks giant investigations into targeted batches, distributes them throughout parallel brokers, and synthesizes their findings into one report. Devin then turns its findings into PRs able to assessment.

Teams testing Code Scans forward of launch are already seeing outcomes:

Code Scans had a big affect on the issues we care most about: software program high quality, bug fixes, stability, efficiency, and compliance, together with safety and privateness. With an estimated 96% PR merge charge throughout a number of repos, we estimate we have saved over 700 engineering hours in our brief testing timeframe.

Digital Computational Pathology, Enterprise Informatics at Philips

PR merge charge
96%

Engineering hours saved
700+

To get began, sort /scan within the Devin webapp, or learn the docs.

Start with a purpose

You don’t have to know which information to take a look at earlier than beginning a scan. Instead, you outline what you’re searching for, and Devin works with you to show that purpose right into a concrete codebase investigation.

For instance:

Find unused code in our net app. Exclude generated information and take a look at fixtures, and test for oblique references earlier than recommending a removing.

You also can convey your personal standards: a crew’s coding requirements, an accessibility guidelines, or necessities for an upcoming migration. Devin helps set up what to examine, what to skip, and what ought to depend as a discovering.

Once you affirm the scope and settings, Devin runs the investigation and brings again a listing of findings ordered by precedence. From there, you’ll be able to examine the proof, focus on the outcomes with Devin, and ask it to open PRs for the problems you need to handle.

Improve Rust compilation time

We requested Code Scans to hurry up compilation within the Dioxus repository. Devin recognized alternatives to streamline dependencies and construct configuration, together with making heavyweight CLI options opt-in moderately than compiling them by default. After making use of the modifications regionally, clear debug construct time dropped from 58.6 seconds to 21.0 seconds—a 64% discount throughout the 22 workspace crates examined.

Scan findings

dioxus · compile-time scan

Example findings · ordered by precedence

website positioning Optimization

We ran a scan for website positioning points throughout devin.ai and cognition.com. It surfaced 44 findings throughout the 2 repositories, and we shipped fixes over the next days. Comparing Ahrefs crawls earlier than and after:

  • Ahrefs well being rating elevated from 87 to 92 on devin.ai.
  • Slow pages decreased by 73% on devin.ai.
  • Missing picture alt textual content was eradicated on cognition.com.

Scan findings

devin.ai + cognition.com · website positioning scan

Example findings · ordered by precedence

Agentic MapReduce

Code Scans is constructed on prime of Agentic MapReduce, the structure we constructed for Devin Security Swarm, to make codebase-wide investigations sensible. It works in 4 phases:

  1. Plan. Devin research your repository and defines guidelines for figuring out code related to your purpose.
  2. Shard. Those guidelines run throughout the codebase, and the matching code is split into targeted batches.
  3. Map. Parallel Devin brokers examine every batch, studying surrounding code as wanted and reporting their findings.
  4. Reduce. A ultimate agent combines the findings, removes duplicates, and prioritizes the outcomes into one report.

Agentic MapReduce Pipeline

dead-code scan instance

1. Plan

Devin research the repository and defines guidelines for the code related to your purpose — right here, symbols, modules, and dependencies which will not be used.

exports with no importersunreferenced modulesunused dependenciesstale characteristic flags

This retains every agent’s context targeted and directs the reasoning funds towards related code moderately than repeated looking. This structure additionally ensures completeness: each chosen batch have to be processed. Code Scans brings that very same strategy past safety to the engineering objectives you outline.

What would you scan for?

Code Scans can examine a variety of engineering questions, utilizing your codebase’s conventions and the factors you present. Here are some examples:

Scan Goal
Performance Find sluggish paths, redundant computation, and missed caching alternatives that would make your utility quicker.
Database queries Look for N+1 queries, pointless spherical journeys, unbounded reads, and different inefficient or unreliable data-access patterns.
Test protection Identify necessary flows, edge circumstances, and failure paths that aren’t lined by exams.
Dead code Find unused capabilities, modules, dependencies, and out of date characteristic flags, with proof for what can safely be eliminated.
Code high quality Look for duplicated logic, pointless complexity, higher abstraction alternatives, and patterns that violate your crew’s coding requirements.
Cleanup Identify redundant abstractions, extreme boilerplate, and code that may be simplified with out altering conduct.
Telemetry Find gaps in logging, metrics, and tracing that make failures troublesome to diagnose or necessary conduct troublesome to measure.
Accessibility Look for lacking labels, damaged keyboard interactions, and different gaps towards the WCAG standards you specify.
Compliance Investigate sensitive-data dealing with, audit trails, and retention logic towards your group’s regulatory necessities and insurance policies.
Migration planning Trace current dependencies, end-to-end flows, and enterprise logic to supply a plan for an upcoming migration.
website positioning Optimization Find code-level points affecting search visibility, together with lacking or duplicated metadata, incorrect canonical URLs, indexing directives, and gaps in sitemaps or structured knowledge.
Your personal Define a sample you need Devin to search for all through the codebase.

The most helpful scan may come from a query your crew has been pushing aside as a result of answering it meant wanting in every single place.

Type /scan in your Devin session, specify what you need to examine, construct the scope collectively, and begin optimizing your codebase as we speak.

Try Code Scans at devin.ai and be taught extra within the Code Scans docs.



Source link