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.
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.
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.
The inspection detects misuse of binary operands (arguments of binary operations).
For example:
height - x
(in most cases it should beheight - y
)j < params
(should beparams.length
)
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.
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.