move code from ValueFlow plugin to FormulaEvaluator