| Conditions | 1 |
| Total Lines | 753 |
| Code Lines | 707 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | from collections.abc import Iterable |
||
| 37 | from gui import listbox_chooser, radiobutton_chooser |
||
| 38 | |||
| 39 | graph_atlas = graphs.atlas() |
||
| 40 | |||
| 41 | choices = listbox_chooser('Choose Graph', graph_atlas) |
||
| 42 | |||
| 43 | model = model(choices) |
||
| 44 | |||
| 45 | # or |
||
| 46 | # model(graph_atlas.values()) |
||
| 47 | |||
| 48 | result = radiobutton_chooser('Choose Materializer', |
||
| 49 | options={m.name: m.value for m in Materializers}, |
||
| 50 | default=(None, None)) |
||
| 51 | builder, handler = result[1] |
||
| 52 | |||
| 53 | graphinate.materialize(model, builder=builder, builder_output_handler=handler) |
||
| 54 |