Hi everyone,
I'm trying to reimplement the existing template analyses for the
TPTP-based smell detection. From my understanding, the following has
been implemented so far:
- RULE1: unreferenced template -> remove (not yet implemented as
refactoring)
- RULE2: only 1 reference -> inline template
- RULE3: multiple references, no formal parameters ("maximise
maintainability") -> inline template
- RULE4(?): all references to parameterised template use the same actual
paramaters -> inline template params
- RULE5: all fields defined by formal parameters -> inline template
- RULE6: formal params that aren't actually used -> remove parameter
(not yet implemented)
Plus the merging rules, but I'm leaving them for now.
Comparing these rules with my smell catalogue, I get to the following:
RULE 1: Special case of smell "Unused Definition" (I'm going to
introduce another subcategory "Unused Definition" with specialized rules
"Unused ..." and matching quickfixes/refactorings)
RULE 2: "Singular Template Reference"
RULE 3: I don't get the point here; why is it considered bad if there
are multiple references to a non-parameterized templated? In my opinion,
inlining the template leads to duplicated inline templates (which is
another smell in my catalogue)
RULE 4: Special case of "Unneeded Parameter" (maybe I'll find a more
suitable name for this) - same as #1
RULE 5: I haven't had this one yet... But good idea! ;)
RULE 6: Special case of "Unused Parameter", same as #1
Can anyone help me with RULE 3?
Thanks,
Martin