How to exlude a method with cane gem to avoid abc complexity

95 Views Asked by At

Hi i am working on a RoR project with cane gem. I have a method inside an interactor. I am getting Methods exceeded maximum allowed ABC complexity (1): For this method. I want to exclude this method to check complexity. So I tried:

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

But still it throws the same error. Please help me how can I ignore ABC complexity only for this method. Thanks in advance.

1

There are 1 best solutions below

1
Jan Klimo On BEST ANSWER

Looking at the docs, I believe you'll need to go with:

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

(notice the # sign where you had a .)