Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

Ruby on Rails | Reek | ReekのUtilityFunction警告がclass << selfに対応していない

概要

ReekのUtilityFunction警告がclass << selfに対応していない

詳細

ReekのUtilityFunction警告がclass << selfに対応していないので、

class << self
  def class_method
  # : 実処理
  end
end

def self.class_method
  # : 実処理
end

で書かないと、ユーティリティ関数のチェック(UtilityFunction)に引っかかってします。
GitHubで管理している認識済み課題のようです。
https://github.com/troessner/reek/issues/112

まだ対応中のようなので、仕方なく後者で記述。
個人的には前者の記述の方が好きなので残念。