Skip to content

Commit 92217e5

Browse files
committed
Closes #27 - Saner check names
1 parent 293016f commit 92217e5

File tree

7 files changed

+334
-337
lines changed

7 files changed

+334
-337
lines changed

config/codeigniter.cfg.xml

+21-21
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,16 @@
158158
are followed by a space before the opening parenthesis.
159159
PEAR standard stipulates this to distinguish it from function calls.
160160
-->
161-
<test name="spaceAfterControlStmt"/>
161+
<test name="spaceAfterControlStatement"/>
162162

163163
<!-- Check that there is no space after a function name in a function call -->
164164
<test name="noSpaceAfterFunctionName" level="info"></test>
165165

166166
<!-- Check for the (required) presence of a white space after some tokens : "," "}" "-" -->
167-
<test name="checkWhiteSpaceAfter"/>
167+
<test name="whiteSpaceAfter"/>
168168

169169
<!-- Check for the (required) presence of a white space before some tokens : "{" "-" -->
170-
<test name="checkWhiteSpaceBefore">
170+
<test name="whiteSpaceBefore">
171171
<exception value=":"/> <!-- Because of the switch/case -->
172172
</test>
173173

@@ -184,7 +184,7 @@
184184
<!-- Check that the lenght of the line doesn't pass the max value -->
185185
<test name="lineLength" level="info">
186186
<property name="maxLineLength" value="160"/>
187-
<property name="checkHTMLLines" value="false"/>
187+
<property name="htmlLines" value="false"/>
188188
</test>
189189

190190
<!-- Checks that the lenght (in lines) of a function doesn't pass the max value -->
@@ -212,7 +212,7 @@
212212

213213
<!-- Check for prohibited functions -->
214214
<!-- @see http://www.php.net/manual/en/indexes.php -->
215-
<test name="checkProhibitedFunctions">
215+
<test name="prohibitedFunctions">
216216
<item value="echo"/>
217217
<item value="system"/>
218218
<item value="print_r"/>
@@ -234,7 +234,7 @@
234234

235235
<!-- Check for prohibited tokens -->
236236
<!-- @see http://www.php.net/manual/en/tokens.php -->
237-
<test name="checkProhibitedTokens">
237+
<test name="prohibitedTokens">
238238
<item value="T_BAD_CHARACTER"/>
239239
<item value="T_DECLARE"/>
240240
<item value="T_ENDDECLARE"/>
@@ -262,7 +262,7 @@
262262
<test name="defaultValuesOrder"/>
263263

264264
<!-- Check for silenced errors before function calls (@function) -->
265-
<test name="checkSilencedError">
265+
<test name="silencedError">
266266
<exception value="rename"/> <!-- Exceptions to this rule -->
267267
<exception value="mkdir"/>
268268
<exception value="chmod"/>
@@ -274,21 +274,21 @@
274274
<!-- Avoid passing parameters by reference -->
275275
<test name="avoidPassingReferences"/>
276276

277-
<test name="showTODOs"/>
277+
<test name="showTodo"/>
278278

279279
<!-- Use boolean operators (&&) instead of logical operators (AND) -->
280280
<test name="useBooleanOperators"/>
281281

282282
<!-- Check empty block like if ($a) {} -->
283-
<test name="checkEmptyBlock">
283+
<test name="emptyBlock">
284284
<!-- <exception value="catch"/> -->
285285
</test>
286286

287287
<!-- Check empty statement ( ;; ) -->
288-
<test name="checkEmptyStatement"/>
288+
<test name="emptyStatement"/>
289289

290290
<!-- Check for the presence of heredoc -->
291-
<test name="checkHeredoc"/>
291+
<test name="heredoc"/>
292292

293293
<!-- Check for braces around code blocs (if, else, elseif, do, while, for, foreach) -->
294294
<test name="needBraces"/>
@@ -306,39 +306,39 @@
306306
Avoid using unary operators (++) inside a control statement
307307
With the exception of for iterators, all variable incrementation or decrementation should occur in their own toplevel statement to increase readability.
308308
-->
309-
<test name="checkUnaryOperator">
309+
<test name="unaryOperator">
310310
<exception value="for"/>
311311
</test>
312312

313313
<!--
314314
With inner assignments it is difficult to see all places where a variable is set.
315315
With the exception of for iterators, all assignments should occur in their own toplevel statement to increase readability.
316316
-->
317-
<test name="checkInnerAssignment">
317+
<test name="innerAssignment">
318318
<exception value="for"/>
319319
</test>
320320

321321
<!-- Only one class declaration per PHP file -->
322322
<test name="oneClassPerFile"/>
323323

324324
<!-- Detect empty files -->
325-
<test name="checkEmptyFile"/>
325+
<test name="emptyFile"/>
326326

327327
<!-- **************** -->
328328
<!-- Unused -->
329329
<!-- **************** -->
330330

331331
<!-- Detect unused private functions (detecting unused public ones is more difficult) -->
332-
<test name="checkUnusedPrivateFunctions"/>
332+
<test name="unusedPrivateFunctions"/>
333333

334334
<!-- Detect unused variables -->
335-
<test name="checkUnusedVariables"/>
335+
<test name="unusedVariables"/>
336336

337337
<!-- Detect unused function parameters -->
338-
<test name="checkUnusedFunctionParameters"/>
338+
<test name="unusedFunctionParameters"/>
339339

340340
<!-- Detect unused code (after return or throw) -->
341-
<test name="checkUnusedCode"/>
341+
<test name="unusedCode"/>
342342

343343
<!-- ******************* -->
344344
<!-- Optimisation -->
@@ -353,7 +353,7 @@
353353
<!-- ******************* -->
354354

355355
<!-- Replace deprecated methods -->
356-
<test name="checkDeprecation">
356+
<test name="deprecation">
357357
<deprecated old="call_user_method" new="call_user_func" version="4.1"/>
358358
<deprecated old="call_user_method_array" new="call_user_func_array" version="4.1"/>
359359
<deprecated old="define_syslog_variables" new="none" version="5.4"/>
@@ -404,7 +404,7 @@
404404
<!-- ******************* -->
405405

406406
<!-- Replace deprecated methods -->
407-
<test name="checkAliases">
407+
<test name="aliases">
408408
<alias old="chop" new="rtrim()"/>
409409
<alias old="close" new="closedir()"/>
410410
<alias old="die" new="exit()"/>
@@ -432,7 +432,7 @@
432432
<!-- ********************************************* -->
433433

434434
<!-- Replace methods -->
435-
<test name="checkReplacements">
435+
<test name="replacements">
436436
<replacement old="$_POST" new="$this->input->post()"/>
437437
<replacement old="$_GET" new="$this->input->get()"/>
438438
<!-- <replacement old="$_SERVER" new="$this->input->server()"/> -->

config/default.cfg.xml

+20-20
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,16 @@
187187
are followed by a space before the opening parenthesis.
188188
PEAR standard stipulates this to distinguish it from function calls.
189189
-->
190-
<test name="spaceAfterControlStmt"/>
190+
<test name="spaceAfterControlStatement"/>
191191

192192
<!-- Check that there is no space after a function name in a function call -->
193193
<test name="noSpaceAfterFunctionName" level="info"></test>
194194

195195
<!-- Check for the (required) presence of a white space after some tokens : "," "}" "-" -->
196-
<test name="checkWhiteSpaceAfter"/>
196+
<test name="whiteSpaceAfter"/>
197197

198198
<!-- Check for the (required) presence of a white space before some tokens : "{" "-" -->
199-
<test name="checkWhiteSpaceBefore">
199+
<test name="whiteSpaceBefore">
200200
<exception value=":"/> <!-- Because of the switch/case -->
201201
</test>
202202

@@ -213,7 +213,7 @@
213213
<!-- Check that the lenght of the line doesn't pass the max value -->
214214
<test name="lineLength" level="info">
215215
<property name="maxLineLength" value="160"/>
216-
<property name="checkHTMLLines" value="false"/>
216+
<property name="htmlLines" value="false"/>
217217
</test>
218218

219219
<!-- Checks that the lenght (in lines) of a function doesn't pass the max value -->
@@ -249,7 +249,7 @@
249249

250250
<!-- Check for prohibited functions -->
251251
<!-- @see http://www.php.net/manual/en/indexes.php -->
252-
<test name="checkProhibitedFunctions">
252+
<test name="prohibitedFunctions">
253253
<item value="echo"/>
254254
<item value="system"/>
255255
<item value="print_r"/>
@@ -271,7 +271,7 @@
271271

272272
<!-- Check for prohibited tokens -->
273273
<!-- @see http://www.php.net/manual/en/tokens.php -->
274-
<test name="checkProhibitedTokens">
274+
<test name="prohibitedTokens">
275275
<item value="T_BAD_CHARACTER"/>
276276
<item value="T_DECLARE"/>
277277
<item value="T_ENDDECLARE"/>
@@ -300,7 +300,7 @@
300300
<test name="defaultValuesOrder"/>
301301

302302
<!-- Check for silenced errors before function calls (@function) -->
303-
<test name="checkSilencedError">
303+
<test name="silencedError">
304304
<exception value="rename"/> <!-- Exceptions to this rule -->
305305
<exception value="mkdir"/>
306306
<exception value="chmod"/>
@@ -312,21 +312,21 @@
312312
<!-- Avoid passing parameters by reference -->
313313
<test name="avoidPassingReferences"/>
314314

315-
<test name="showTODOs"/>
315+
<test name="showTodo"/>
316316

317317
<!-- Use boolean operators (&&) instead of logical operators (AND) -->
318318
<test name="useBooleanOperators"/>
319319

320320
<!-- Check empty block like if ($a) {} -->
321-
<test name="checkEmptyBlock">
321+
<test name="emptyBlock">
322322
<!-- <exception value="catch"/> -->
323323
</test>
324324

325325
<!-- Check empty statement ( ;; ) -->
326-
<test name="checkEmptyStatement"/>
326+
<test name="emptyStatement"/>
327327

328328
<!-- Check for the presence of heredoc -->
329-
<test name="checkHeredoc"/>
329+
<test name="heredoc"/>
330330

331331
<!-- Check for braces around code blocs (if, else, elseif, do, while, for, foreach) -->
332332
<test name="needBraces"/>
@@ -344,39 +344,39 @@
344344
Avoid using unary operators (++) inside a control statement
345345
With the exception of for iterators, all variable incrementation or decrementation should occur in their own toplevel statement to increase readability.
346346
-->
347-
<test name="checkUnaryOperator">
347+
<test name="unaryOperator">
348348
<exception value="for"/>
349349
</test>
350350

351351
<!--
352352
With inner assignments it is difficult to see all places where a variable is set.
353353
With the exception of for iterators, all assignments should occur in their own toplevel statement to increase readability.
354354
-->
355-
<test name="checkInnerAssignment">
355+
<test name="innerAssignment">
356356
<exception value="for"/>
357357
</test>
358358

359359
<!-- Only one class declaration per PHP file -->
360360
<test name="oneClassPerFile"/>
361361

362362
<!-- Detect empty files -->
363-
<test name="checkEmptyFile"/>
363+
<test name="emptyFile"/>
364364

365365
<!-- **************** -->
366366
<!-- Unused -->
367367
<!-- **************** -->
368368

369369
<!-- Detect unused private functions (detecting unused public ones is more difficult) -->
370-
<test name="checkUnusedPrivateFunctions"/>
370+
<test name="unusedPrivateFunctions"/>
371371

372372
<!-- Detect unused variables -->
373-
<test name="checkUnusedVariables"/>
373+
<test name="unusedVariables"/>
374374

375375
<!-- Detect unused function parameters -->
376-
<test name="checkUnusedFunctionParameters"/>
376+
<test name="unusedFunctionParameters"/>
377377

378378
<!-- Detect unused code (after return or throw) -->
379-
<test name="checkUnusedCode"/>
379+
<test name="unusedCode"/>
380380

381381
<!-- ******************* -->
382382
<!-- Optimisation -->
@@ -391,7 +391,7 @@
391391
<!-- ******************* -->
392392

393393
<!-- Replace deprecated methods -->
394-
<test name="checkDeprecation">
394+
<test name="deprecation">
395395
<deprecated old="call_user_method" new="call_user_func" version="4.1"/>
396396
<deprecated old="call_user_method_array" new="call_user_func_array" version="4.1"/>
397397
<deprecated old="define_syslog_variables" new="none" version="5.4"/>
@@ -442,7 +442,7 @@
442442
<!-- ******************* -->
443443

444444
<!-- Replace deprecated methods -->
445-
<test name="checkAliases">
445+
<test name="aliases">
446446
<alias old="chop" new="rtrim()"/>
447447
<alias old="close" new="closedir()"/>
448448
<alias old="die" new="exit()"/>

0 commit comments

Comments
 (0)