Press esc to head back
 

​AI-Powered Pull Request Review Using Qodo AI PR-Agent

​

Automated Code Review and Insights for Developers

Solution – Qodo AI PR-Agent

Qodo PR-Agent is an open-source tool to help efficiently review and handle pull requests. Qodo Merge is a hosted version of PR-Agent, designed for companies and teams that require additional features and capabilities

01

Automates PR description and code review

02

Detects bugs, typos, and bad practices

03

Provides clear suggestions and insights

04

Integrates directly in github​

 

Problem statement​

  • PR reviews are time-consuming
  • Prone to human oversight, leading to bugs.
  • Inconsistent across reviewers due to varying experience levels.

Implementation

We planned to test Qodo AI’s effectiveness by simulating real-world scenarios. A GitHub repo with a simple React login page was created. Two pull requests were made—one with valid features and one with intentional mistakes—to evaluate Qodo’s review capabilities. 

01

Created a repo with a simple React login page

02

Created a PR with valid features for review

03

Created a PR with mistakes to test detection

04

Used Qodo’s commands to test

Contact us

Lorem ipsum 

Lorem ipsum 

Address 1

PR 1: Feature additions 

In this pull request, we enhanced a basic login form using React functional components and hooks. Key features added include form validation, password visibility toggle, and “Remember Me” functionality using localStorage. The login process simulates an API call with a loading state and user feedback. This PR demonstrates clean code, proper state management, and user-friendly enhancements suitable for testing Qodo AI's ability to describe and review a well-structured feature implementation.

01

Used useState and useEffect hooks

02

Added form validation

03

Used localStorage to remember username

04
  • Simulated login with loading state
  • Showed error message if fields are empty
  • Alerted user on successful login

Qodo's response​

PR 2 with Mistakes 

In this pull request, we enhanced a basic login form using React functional components and hooks. Key features added include form validation, password visibility toggle, and “Remember Me” functionality using localStorage. The login process simulates an API call with a loading state and user feedback. This PR demonstrates clean code, proper state management, and user-friendly enhancements suitable for testing Qodo AI's ability to describe and review a well-structured feature implementation.

01

Created a login form with errors to test Qodo AI

02

Used incorrect state and variable names (e.g., pass, show, errMsg)

03

Password validation logic is incorrect – valid password shown as incorrect

04
  • Used static value for username input, so user can't type
  • Typo in input type: "pasword" instead of "password"
  • Unused state: unusedState, usernameText
  • Incorrect inline style property: fontSizee
  • Function name typo: handleSubmision

Qodo's response​

 Qodo's AI Review – Analysis

The Qodo AI Review provided an in-depth automated analysis for both submitted PRs, highlighting key areas of improvement, security concerns, and code quality insights. In PR 1, which introduced new enhancements like password visibility toggle, "Remember Me" functionality via localStorage, and better login error handling, Qodo AI assessed the review effort as low (2/5) and flagged the absence of relevant tests. It raised mild security concerns, particularly the exposure of the username in an alert post-login and unencrypted storage of usernames. The AI recommended additional validation (e.g., password strength checks), resetting stale error messages, and improving input accessibility. When asked if the PR could break in production, Qodo confidently assessed it as stable due to well-structured UI logic, correct use of React state, and no changes to core authentication mechanisms.

In contrast, PR 2, which involved both enhancement and bug fixes, was deemed to require medium review effort (3/5) and exposed significant issues. The AI detected a critical security flaw — a hardcoded password check (admin123) — posing a high risk. It also flagged a flawed login logic where error messages displayed regardless of valid input, and the login process continued even on incorrect credentials. Additional issues included a hardcoded username input, preventing user interaction, and multiple typos in CSS properties and function names. Qodo AI provided targeted suggestions to resolve these high-impact problems, including fixing input bindings, correcting logic flow, and improving code readability.

Overall, Qodo AI demonstrated robust review capabilities by automatically identifying vulnerabilities, offering actionable suggestions, and assessing the potential impact of changes. It significantly reduced manual review overhead and ensured better code hygiene before production deployment, thereby enhancing both developer productivity and code reliability.

We successfully tested Qodo AI PR-Agent by simulating real-world pull requests—both valid and flawed. Qodo provided accurate insights, helped identify coding mistakes, and automated review tasks. Moving forward, we aim to explore its full potential across different projects to enhance code quality, save time, and improve development workflows.

                    THANK YOU