relaton / relaton-iso

RelatonIso: ISO Standards metadata using the BibliographicItem model
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Duplicate Methods #119

Closed andrew2net closed 2 years ago

andrew2net commented 2 years ago

Method RelatonIso::DocumentIdentifier#all_parts is defined at both lib/relaton_iso/document_identifier.rb:3 and lib/relaton_iso/document_identifier.rb:24. (warning:Lint/DuplicateMethods)

  1. There is RelatonBib::DocumentIdentifier#all_parts method in parent class.
  2. Rubocop climes it as an offence. There are many offences in the code but we should try to reduce the number of them, not make new.
  3. By conventional, if there is an instance variable the getter should has same name as the variable. We have @all_parts instance variable in the RelatonIso::DocumentIdentifier but the method #all_parts isn't getter, it's setter. I think the method should be named #set_all_parts_true or #set_all_parts(all_parts=true), and I don't think we need attr_accessor :all_parts at alll.
andrew2net commented 2 years ago

I fixed it