| Conditions | 1 |
| Total Lines | 52 |
| Code Lines | 43 |
| 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 | import pytest |
||
| 74 | def test_traverse_gabaa(self): |
||
| 75 | x = dict( |
||
| 76 | target_chembl_id="CHEMBL5112", |
||
| 77 | pref_name="GABA receptor alpha-5 subunit", |
||
| 78 | target_type="SINGLE PROTEIN", |
||
| 79 | ) |
||
| 80 | x_row1 = dict( |
||
| 81 | target_chembl_id="CHEMBL2093872", |
||
| 82 | pref_name="GABA-A receptor; anion channel", |
||
| 83 | target_type="PROTEIN COMPLEX GROUP", |
||
| 84 | ) |
||
| 85 | x_row1_superset = dict( |
||
| 86 | target_chembl_id="CHEMBL1111", pref_name="supergroup", target_type="SELECTIVITY FILTER" |
||
| 87 | ) |
||
| 88 | x_row2 = dict( |
||
| 89 | target_chembl_id="CHEMBL2094122", |
||
| 90 | pref_name="GABA-A receptor; alpha-5/beta-3/gamma-2", |
||
| 91 | target_type="PROTEIN COMPLEX", |
||
| 92 | ) |
||
| 93 | x_row3 = dict( |
||
| 94 | target_chembl_id="CHEMBL2109243", |
||
| 95 | pref_name="GABA-A receptor; benzodiazepine site", |
||
| 96 | target_type="PROTEIN COMPLEX GROUP", |
||
| 97 | ) |
||
| 98 | x_row4 = dict( |
||
| 99 | target_chembl_id="CHEMBL2109244", |
||
| 100 | pref_name="GABA-A receptor; agonist GABA site", |
||
| 101 | target_type="PROTEIN COMPLEX GROUP", |
||
| 102 | ) |
||
| 103 | x_row5 = dict( |
||
| 104 | target_chembl_id="CHEMBL3885576", |
||
| 105 | pref_name="Gamma-aminobutyric acid receptor subunit alpha-5/beta-2", |
||
| 106 | target_type="PROTEIN COMPLEX", |
||
| 107 | ) |
||
| 108 | x_row6 = dict( |
||
| 109 | target_chembl_id="CHEMBL3885577", |
||
| 110 | pref_name="Gamma-aminobutyric acid receptor subunit alpha-5/beta-3/gamma-3", |
||
| 111 | target_type="PROTEIN COMPLEX", |
||
| 112 | ) |
||
| 113 | x_row7 = dict( |
||
| 114 | target_chembl_id="CHEMBL4296057", |
||
| 115 | pref_name="Gamma-aminobutyric acid receptor subunit alpha-5/beta-3", |
||
| 116 | target_type="PROTEIN COMPLEX", |
||
| 117 | ) |
||
| 118 | xrow2_row2 = x_row1 |
||
| 119 | xrow3_row3 = x_row1 |
||
| 120 | xrow4_row5 = x_row1 |
||
| 121 | xrow5_row3 = x_row1 |
||
| 122 | xrow5_row7 = x_row4 |
||
| 123 | relations = [ |
||
| 124 | dict(relationship="SUBSET OF", related_target_chembl_id="CHEMBL1111"), |
||
| 125 | dict(relationship="SUBSET OF", related_target_chembl_id="CHEMBL0000"), |
||
| 126 | ] |
||
| 132 |