benchexec icon indicating copy to clipboard operation
benchexec copied to clipboard

Refactor setHashSearch in JS code

Open PhilippWendler opened this issue 3 years ago • 0 comments

The method setHashSearch is not well designed and should be refactored.

It implements both the creation of the new hash string as well as (optionally) two(!) different side effects of what to do with the string. So the method should be split into the side-effect-free string creation and (if necessary) other methods handling the side effects. In this regard #805 and the avoiding of manual history manipulation could be relevant.

Furthermore, the method is not used well, because for example the method offers the keepOthers feature, which only some callers use. The other calls manually merge old and new hash params into a dict before, which could be replaced with setting keepOthers to false. And if I did not overlook something, there actually does not exist a use case for keepOthers = false, so this could be removed.

But first we need more tests for this method.

PhilippWendler avatar Jan 25 '22 12:01 PhilippWendler