| Conditions | 1 |
| Total Lines | 52 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 | # This Python file uses the following encoding: utf-8 |
||
| 69 | def test_numbering_levels(): |
||
| 70 | verify_conversion( |
||
| 71 | ''' |
||
| 72 | --- |
||
| 73 | pandoc-numbering: |
||
| 74 | exercise: |
||
| 75 | general: |
||
| 76 | first-section-level: 2 |
||
| 77 | last-section-level: 2 |
||
| 78 | --- |
||
| 79 | |||
| 80 | First chapter |
||
| 81 | ============= |
||
| 82 | |||
| 83 | Second chapter |
||
| 84 | ============== |
||
| 85 | |||
| 86 | First section |
||
| 87 | ------------- |
||
| 88 | |||
| 89 | Second section |
||
| 90 | -------------- |
||
| 91 | |||
| 92 | Exercise # |
||
| 93 | |||
| 94 | Exercise (Title) # |
||
| 95 | ''', |
||
| 96 | ''' |
||
| 97 | --- |
||
| 98 | pandoc-numbering: |
||
| 99 | exercise: |
||
| 100 | general: |
||
| 101 | first-section-level: 2 |
||
| 102 | last-section-level: 2 |
||
| 103 | --- |
||
| 104 | |||
| 105 | First chapter |
||
| 106 | ============= |
||
| 107 | |||
| 108 | Second chapter |
||
| 109 | ============== |
||
| 110 | |||
| 111 | First section |
||
| 112 | ------------- |
||
| 113 | |||
| 114 | Second section |
||
| 115 | -------------- |
||
| 116 | |||
| 117 | [**Exercise 2.1**]{#exercise:2.2.1 .pandoc-numbering-text .exercise} |
||
| 118 | |||
| 119 | [**Exercise 2.2** *(Title)*]{#exercise:2.2.2 .pandoc-numbering-text .exercise} |
||
| 120 | ''' |
||
| 121 | ) |
||
| 175 |