← All posts

Release: DeepSource Ruby analyzer lands in beta

DeepSource now supports Ruby, with 170+ types of issues.

Header image
By Sourya on 
Share on Twitter Share on LinkedIn Share on Facebook

Ever since its inception in 1995, Ruby has been a programming language that is "a simple Lisp language at its core, with an object system like that of Smalltalk, blocks inspired by higher-order functions, and practical utility like that of Perl".

Add to it the fact that you get to use Rails, and you have one of the most loved and widely used programming languages in the world. What’s not to love!

Today, we are excited to launch continuous static analysis for Ruby, detecting 170+ issues, like bug risks, anti-patterns, security vulnerabilities, and style issues.

Using the Ruby analyzer

To start analyzing your Ruby code, just enable the ruby analyzer in your .deepsource.toml file, and you are good to go.

Sample configuration

version = 1

test_patterns = [
  "test/**",
  "*_test.rb"
]

exclude_patterns = [
  "vendor/**",
  "**/examples/**"
]

[[analyzers]]
name = "ruby"
enabled = true

Issues detected by the Ruby analyzer

At the time of writing this, the analyzer detects 170+ issues in your Ruby code, across categories like bug risks, anti-patterns, security vulnerabilities, and style issues. Here’s some of them to give you an idea:

Bug risks:

  • Iterable is called with with_index, but its value is never used
  • Unreachable code detected

Security issues:

  • Use of Kernel#open detected
  • Use of Kernel#eval/Binding#eval detected

Antipatterns:

  • A block can be used that cleans up resources automatically on closing
  • Use of class variables detected

We’re very excited about this release, and hope that this will help you avoid many issues in your code, and make writing Ruby even more fun! Head over to the docs or tell us what you think!

About DeepSource
DeepSource helps you automatically find and fix issues in your code during code reviews, such as bug risks, anti-patterns, performance issues, and security flaws. It takes less than 5 minutes to set up with your Bitbucket, GitHub, or GitLab account. It works for Python, Go, Ruby, and JavaScript.
Get started for free

Keep reading...