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