| Conditions | 1 |
| Paths | 1 |
| Total Lines | 81 |
| Code Lines | 40 |
| 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 |
||
| 63 | public function provideComplete() |
||
| 64 | { |
||
| 65 | return [ |
||
| 66 | [ |
||
| 67 | // Google partiel |
||
| 68 | '{{Ouvrage|titre=}}', |
||
| 69 | '{{Ouvrage|titre=|présentation en ligne=Google}}', |
||
| 70 | '{{Ouvrage|titre=|éditeur=|année=|isbn=|présentation en ligne=Google}}', |
||
| 71 | ], |
||
| 72 | [ |
||
| 73 | // Google total |
||
| 74 | '{{Ouvrage|titre=}}', |
||
| 75 | '{{Ouvrage|titre=|lire en ligne=Google}}', |
||
| 76 | '{{Ouvrage|titre=|éditeur=|année=|isbn=|lire en ligne=Google}}', |
||
| 77 | ], |
||
| 78 | [ |
||
| 79 | //isbn invalide |
||
| 80 | '{{Ouvrage|titre=}}', |
||
| 81 | '{{Ouvrage|titre=|isbn invalide=bla}}', |
||
| 82 | '{{Ouvrage|titre=|éditeur=|année=|isbn=}}', |
||
| 83 | ], |
||
| 84 | // date/année |
||
| 85 | [ |
||
| 86 | '{{Ouvrage|titre=}}', |
||
| 87 | '{{Ouvrage|titre=|année=2009}}', |
||
| 88 | '{{Ouvrage|titre=|éditeur=|année=2009|isbn=}}', |
||
| 89 | ], |
||
| 90 | [ |
||
| 91 | '{{Ouvrage|titre=|date=2011}}', |
||
| 92 | '{{Ouvrage|titre=|année=2009}}', |
||
| 93 | '{{Ouvrage|titre=|éditeur=|date=2011|isbn=}}', |
||
| 94 | ], |
||
| 95 | /** |
||
| 96 | * titre + sous-titre |
||
| 97 | */ |
||
| 98 | // pas d'ajout si déjà titre volume/chapitre/tome ou nature ouvrage |
||
| 99 | [ |
||
| 100 | '{{Ouvrage|titre = Loiret Joli|titre chapitre=Bla}}', |
||
| 101 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 102 | '{{Ouvrage|titre=Loiret Joli|éditeur=|année=|isbn=|titre chapitre=Bla}}', |
||
| 103 | ], |
||
| 104 | // titres identiques mais sous-titre manquant |
||
| 105 | [ |
||
| 106 | '{{Ouvrage|titre = Loiret Joli}}', |
||
| 107 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 108 | '{{Ouvrage|titre=Loiret Joli|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 109 | ], |
||
| 110 | // punctuation titre différente, sous-titre manquant |
||
| 111 | [ |
||
| 112 | '{{Ouvrage|titre = Loiret Joli !!!!}}', |
||
| 113 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 114 | '{{Ouvrage|titre=Loiret Joli !!!!|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 115 | ], |
||
| 116 | // sous-titre inclus dans titre original |
||
| 117 | [ |
||
| 118 | '{{Ouvrage|titre = Loiret Joli : un département}}', |
||
| 119 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 120 | '{{Ouvrage|titre=Loiret Joli|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 121 | ], |
||
| 122 | // sous-titre absent online |
||
| 123 | [ |
||
| 124 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 125 | '{{Ouvrage|titre = Loiret Joli}}', |
||
| 126 | '{{Ouvrage|titre=Loiret Joli|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 127 | ], |
||
| 128 | // titre absent online |
||
| 129 | [ |
||
| 130 | '{{Ouvrage|auteur1=bla|titre = Loiret Joli}}', |
||
| 131 | '{{Ouvrage|auteur1=bla}}', |
||
| 132 | '{{Ouvrage|auteur1=bla|titre=Loiret Joli|éditeur=|année=|isbn=}}', |
||
| 133 | ], |
||
| 134 | // titre volume existe -> skip |
||
| 135 | [ |
||
| 136 | '{{Ouvrage|titre = Loiret Joli|titre volume=Bla}}', |
||
| 137 | '{{Ouvrage|titre = Loiret Joli|sous-titre=Fubar}}', |
||
| 138 | '{{Ouvrage|titre=Loiret Joli|titre volume=Bla|éditeur=|année=|isbn=}}', |
||
| 139 | ], |
||
| 140 | [ |
||
| 141 | '{{Ouvrage|titre = Loiret Joli|collection=Bla}}', |
||
| 142 | '{{Ouvrage|titre = Loiret Joli|sous-titre=Fubar}}', |
||
| 143 | '{{Ouvrage|titre=Loiret Joli|éditeur=|collection=Bla|année=|isbn=}}', |
||
| 144 | ], |
||
| 148 |