| Conditions | 1 |
| Paths | 1 |
| Total Lines | 92 |
| Code Lines | 46 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| 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 | // Wikidata+BnF completion of sitelinks |
||
| 68 | '{{Ouvrage|prénom1=Paul|nom1=Durand|titre=La vie}}', |
||
| 69 | '{{Ouvrage|prénom1=Paul|nom1=Durand|lien auteur1=Paul Durand (écrivain)|titre=La Vie|lien titre=La Vie (livre)}}', |
||
| 70 | '{{Ouvrage|prénom1=Paul|nom1=Durand|lien auteur1=Paul Durand (écrivain)|titre=La vie|lien titre=La Vie (livre)|éditeur=|année=|isbn=}}', |
||
| 71 | ], |
||
| 72 | [ |
||
| 73 | // Wikidata+BnF completion of sitelinks : prénoms différents |
||
| 74 | '{{Ouvrage|prénom1=Paul A.|nom1=Durand|titre=La vie|isbn=1234}}', |
||
| 75 | '{{Ouvrage|prénom1=Paul-André|nom1=Durand|lien auteur1=Paul Durand (écrivain)|titre=La Vie|isbn=1234}}', |
||
| 76 | '{{Ouvrage|prénom1=Paul A.|nom1=Durand|lien auteur1=Paul Durand (écrivain)|titre=La vie|éditeur=|année=|isbn=1234}}', |
||
| 77 | ], |
||
| 78 | [ |
||
| 79 | // Google partiel |
||
| 80 | '{{Ouvrage|titre=}}', |
||
| 81 | '{{Ouvrage|titre=|présentation en ligne=https://books.google.com/books?id=day56Sz-rEEC}}', |
||
| 82 | '{{Ouvrage|titre=|éditeur=|année=|isbn=|lire en ligne=https://books.google.com/books?id=day56Sz-rEEC}}', |
||
| 83 | ], |
||
| 84 | [ |
||
| 85 | // Google total |
||
| 86 | '{{Ouvrage|titre=}}', |
||
| 87 | '{{Ouvrage|titre=|lire en ligne=https://books.google.com/books?id=day56Sz-rEEC}}', |
||
| 88 | '{{Ouvrage|titre=|éditeur=|année=|isbn=|lire en ligne=https://books.google.com/books?id=day56Sz-rEEC}}', |
||
| 89 | ], |
||
| 90 | [ |
||
| 91 | //isbn invalide |
||
| 92 | '{{Ouvrage|titre=}}', |
||
| 93 | '{{Ouvrage|titre=|isbn invalide=bla}}', |
||
| 94 | '{{Ouvrage|titre=|éditeur=|année=|isbn=}}', |
||
| 95 | ], |
||
| 96 | // date/année |
||
| 97 | [ |
||
| 98 | '{{Ouvrage|titre=}}', |
||
| 99 | '{{Ouvrage|titre=|année=2009}}', |
||
| 100 | '{{Ouvrage|titre=|éditeur=|année=2009|isbn=}}', |
||
| 101 | ], |
||
| 102 | [ |
||
| 103 | '{{Ouvrage|titre=|date=2011}}', |
||
| 104 | '{{Ouvrage|titre=|année=2009}}', |
||
| 105 | '{{Ouvrage|titre=|éditeur=|date=2011|isbn=}}', |
||
| 106 | ], |
||
| 107 | /* |
||
| 108 | * titre + sous-titre |
||
| 109 | */ // pas d'ajout si déjà titre volume/chapitre/tome ou nature ouvrage |
||
| 110 | [ |
||
| 111 | '{{Ouvrage|titre = Loiret Joli|titre chapitre=Bla}}', |
||
| 112 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 113 | '{{Ouvrage|titre=Loiret Joli|éditeur=|année=|isbn=|titre chapitre=Bla}}', |
||
| 114 | ], |
||
| 115 | // titres identiques mais sous-titre manquant |
||
| 116 | [ |
||
| 117 | '{{Ouvrage|titre = Loiret Joli}}', |
||
| 118 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 119 | '{{Ouvrage|titre=Loiret Joli|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 120 | ], |
||
| 121 | // punctuation titre différente, sous-titre manquant |
||
| 122 | [ |
||
| 123 | '{{Ouvrage|titre = Loiret Joli !!!!}}', |
||
| 124 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 125 | '{{Ouvrage|titre=Loiret Joli !!!!|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 126 | ], |
||
| 127 | // sous-titre inclus dans titre original |
||
| 128 | [ |
||
| 129 | '{{Ouvrage|titre = Loiret Joli : un département}}', |
||
| 130 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 131 | '{{Ouvrage|titre=Loiret Joli|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 132 | ], |
||
| 133 | // sous-titre absent online |
||
| 134 | [ |
||
| 135 | '{{Ouvrage|titre = Loiret Joli|sous-titre=un département}}', |
||
| 136 | '{{Ouvrage|titre = Loiret Joli}}', |
||
| 137 | '{{Ouvrage|titre=Loiret Joli|sous-titre=un département|éditeur=|année=|isbn=}}', |
||
| 138 | ], |
||
| 139 | // titre absent online |
||
| 140 | [ |
||
| 141 | '{{Ouvrage|auteur1=bla|titre = Loiret Joli}}', |
||
| 142 | '{{Ouvrage|auteur1=bla}}', |
||
| 143 | '{{Ouvrage|auteur1=bla|titre=Loiret Joli|éditeur=|année=|isbn=}}', |
||
| 144 | ], |
||
| 145 | // titre volume existe -> skip |
||
| 146 | [ |
||
| 147 | '{{Ouvrage|titre = Loiret Joli|titre volume=Bla}}', |
||
| 148 | '{{Ouvrage|titre = Loiret Joli|sous-titre=Fubar}}', |
||
| 149 | '{{Ouvrage|titre=Loiret Joli|titre volume=Bla|éditeur=|année=|isbn=}}', |
||
| 150 | ], |
||
| 151 | [ |
||
| 152 | '{{Ouvrage|titre = Loiret Joli|collection=Bla}}', |
||
| 153 | '{{Ouvrage|titre = Loiret Joli|sous-titre=Fubar}}', |
||
| 154 | '{{Ouvrage|titre=Loiret Joli|éditeur=|collection=Bla|année=|isbn=}}', |
||
| 155 | ], |
||
| 195 |