| Conditions | 11 |
| Paths | 1024 |
| Total Lines | 38 |
| Code Lines | 24 |
| 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 | <?php |
||
| 80 | protected function parseModifs(string $modifs): void |
||
| 81 | { |
||
| 82 | // Edits avec ajout conséquent de donnée |
||
| 83 | if (preg_match('#distinction des auteurs#', $modifs) > 0) { |
||
| 84 | $this->pageWorkStatus->botFlag = false; |
||
| 85 | $this->addSummaryTag('distinction auteurs 🧠'); |
||
| 86 | } |
||
| 87 | // prédiction paramètre correct |
||
| 88 | if (preg_match('#[^,]+(=>|⇒)[^,]+#', $modifs, $matches) > 0) { |
||
| 89 | $this->pageWorkStatus->botFlag = false; |
||
| 90 | $this->addSummaryTag($matches[0]); |
||
| 91 | } |
||
| 92 | if (preg_match('#\+\+sous-titre#', $modifs) > 0) { |
||
| 93 | $this->pageWorkStatus->botFlag = false; |
||
| 94 | $this->addSummaryTag('+sous-titre'); |
||
| 95 | } |
||
| 96 | if (preg_match('#\+lieu#', $modifs) > 0) { |
||
| 97 | $this->addSummaryTag('+lieu'); |
||
| 98 | } |
||
| 99 | if (preg_match('#tracking#', $modifs) > 0) { |
||
| 100 | $this->addSummaryTag('tracking'); |
||
| 101 | } |
||
| 102 | if (preg_match('#présentation en ligne#', $modifs) > 0) { |
||
| 103 | $this->addSummaryTag('+présentation en ligne✨'); |
||
| 104 | } |
||
| 105 | if (preg_match('#distinction auteurs#', $modifs) > 0) { |
||
| 106 | $this->addSummaryTag('distinction auteurs 🧠'); |
||
| 107 | } |
||
| 108 | if (preg_match('#\+lire en ligne#', $modifs) > 0) { |
||
| 109 | $this->addSummaryTag('+lire en ligne✨'); |
||
| 110 | } |
||
| 111 | if (preg_match('#\+lien #', $modifs) > 0) { |
||
| 112 | $this->addSummaryTag('wikif'); |
||
| 113 | } |
||
| 114 | if (preg_match('#\+éditeur#', $modifs) > 0) { |
||
| 115 | $this->addSummaryTag('éditeur'); |
||
| 116 | } |
||
| 117 | $this->parseBNFdata($modifs); |
||
| 118 | } |
||
| 127 | } |