0

嗨,我正在使用 Cane gem 进行 RoR项目。我在交互器中有一个方法。我得到了Methods exceeded maximum allowed ABC complexity (1): 这种方法。我想排除这种方法来检查复杂性。所以我尝试了:

Cane::RakeTask.new(:code_quality) do |cane|
  cane.abc_max = 15
  cane.no_style = true
  cane.no_doc = true
  cane.abc_exclude = %w(App::Interactors::StoreParserInteractor.find_date_time)
end

但它仍然会引发同样的错误。请帮助我如何仅针对此方法忽略 ABC 复杂性。提前致谢。

4

1 回答 1

1

查看文档,我相信您需要使用:

cane.abc_exclude = %w(App::Interactors::StoreParserInteractor#find_date_time)

(注意#你有 a 的标志.

于 2018-04-15T10:38:01.483 回答