Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

JetBrains-Research/DeepBugsPlugin

Repository files navigation

DeepBugs Icon DeepBugs for IntelliJ

JB Research CircleCI Plugin Gitter JS Plugin JS Downloads Py Plugin Py Downloads

DeepBugs for IntelliJ is a pair of plugins for IntelliJ-based IDEs that provide semantics-aware bug detection in Python and JavaScript. The plugins use deep learning models inspired by the DeepBugs framework to extract the semantics of code and find bugs.

The plugins are available for download: Python, JavaScript.

Getting started

Code inspections in the plugins detect several types of bugs, including incorrect function arguments, incorrect comparison, and others, based on code semantics.

If the plugin provides some warnings that you consider as false positives, you can disable check on any particular piece of code with a quick-fix. All the ignored expressions can be reset in Preferences / Settings under Tools | DeepBugs for Python/DeepBugs for JavaScript.

Supported code inspections

Incorrect binary operator

The inspection detects misuse of binary operators (such as <, <=, +, etc.).

For example, it may detect the following bugs:

  • i <= length (index is less or equal to length, but should be less)
  • text + binary (concatenated non-compatible types)

This inspection provides a quick-fix that allows replacing misused operator with more appropriate one.

Incorrect binary operand

The inspection detects misuse of binary operands (arguments of binary operations).

For example:

  • height - x (in most cases it should be height - y)
  • j < params (should be params.length)

Incorrect function arguments

The inspection detects misuse of function arguments (specifically, their order).

For example:

  • startPoller(100, function(delay, fn) { … }) (should be fn, delay)
  • 2 % i (unusual order of operands)

This inspection provides a quick-fix allowing to fix the order of arguments.

Got any more questions?

If you want to know more about the DeepBugs framework that these plugins are based on, please refer to this paper.

If you have any questions about the plugins themselves, please don’t hesitate to contact us on Gitter.