Closed goneall closed 6 months ago
The first option (separate class dedicated to converting license templates and/or fragments of license templates into regexes) seems like a good option to me. It might be useful to someone independent of the LicenseCompareHelper, and is probably easier to test that way too.
Fixed with PR #224
After PR #221, the method
nonOptionalTextToPatterns
inLicenseCompareHelper
has a complexity of 89 which is far to high.I wasn't able to come up with a clean way to refactor the method into several static methods.
There are a couple alternative approaches:
getStartRegex(int numWords)
andgetEndRegex(int numWords)