| Conditions | 4 | 
| Total Lines | 11 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 1 | 
| CRAP Score | 15.664 | 
| 1 | 1 | from .simplification import simplify | |
| 6 | 1 | def traverse_until_fixpoint(predicate, tree): | |
| 7 | """Traverses the tree again and again until it is not modified.""" | ||
| 8 | old_tree = None | ||
| 9 | tree = simplify(tree) | ||
| 10 | while tree and old_tree != tree: | ||
| 11 | old_tree = tree | ||
| 12 | tree = tree.traverse(predicate) | ||
| 13 | if not tree: | ||
| 14 | return None | ||
| 15 | tree = simplify(tree) | ||
| 16 | return tree | ||
| 17 | |||
| 23 |