Ruby

Ruby

Made by DeepSource

Unnecessary nested calls to File.dirname RB-W1017

Anti-pattern
Minor
Autofix

Starting from Ruby 3.1, File.dirname can be called with a level argument, which is used to get the directory name by going up level amount of directories.

Bad practice

File.dirname(File.dirname(path))

Recommended

File.dirname(path, 2)