Details
Description
Here is a simple example to reproduce. Unzip the attached and analyze. You will only see violations on 6 files. If you open the phpcodesniffer.xml, you will see that many more files have some.
-
- FixPhpCodesnifferViolations.patch
- 13/Nov/10 4:32 PM
- 2 kB
- Mathias kluba
-
- FixPhpCodesnifferViolationsBetter.patch
- 13/Nov/10 4:59 PM
- 16 kB
- Mathias kluba
-
- phpMyAdmin.tar.gz
- 11/Aug/10 11:04 AM
- 4.94 MB
- Gabriele Santini
-
Hide
- phpMyAdmin.zip
- 13/May/10 7:28 AM
- 2.25 MB
- Olivier Gaudin
-
- phpMyAdmin/pom.xml 0.7 kB
- phpMyAdmin/src/browse_foreigners.php 11 kB
- phpMyAdmin/src/bs_change_mime_type.php 4 kB
- phpMyAdmin/src/bs_disp_as_mime_type.php 2 kB
- phpMyAdmin/src/bs_play_media.php 2 kB
- phpMyAdmin/src/calendar.php 0.8 kB
- phpMyAdmin/src/ChangeLog 6 kB
- phpMyAdmin/src/changelog.php 3 kB
- phpMyAdmin/src/chk_rel.php 0.5 kB
- phpMyAdmin/src/config.sample.inc.php 2 kB
- phpMyAdmin/src/CREDITS 0.2 kB
- phpMyAdmin/src/db_create.php 1 kB
- phpMyAdmin/src/db_datadict.php 10 kB
- phpMyAdmin/src/db_export.php 2 kB
- phpMyAdmin/src/db_import.php 0.5 kB
- phpMyAdmin/src/db_operations.php 27 kB
- phpMyAdmin/src/db_printview.php 7 kB
- phpMyAdmin/src/db_qbe.php 30 kB
- phpMyAdmin/src/db_search.php 13 kB
- phpMyAdmin/src/db_sql.php 0.9 kB
- phpMyAdmin/src/db_structure.php 25 kB
- phpMyAdmin/src/db_tracking.php 7 kB
- phpMyAdmin/src/docs.css 3 kB
- phpMyAdmin/src/Documentation.html 243 kB
- phpMyAdmin/src/Documentation.txt 171 kB
- phpMyAdmin/src/error.php 2 kB
- phpMyAdmin/src/export.php 25 kB
- phpMyAdmin/src/favicon.ico 18 kB
- phpMyAdmin/src/import.php 15 kB
- phpMyAdmin/src/import_status.php 1 kB
Activity
PhpCodeSniffer violations will be taken into account only if the rule profile used to analyze the project contains these violations.
If the rule profile contains only a sub part of the violations types, only theses violations are taken into account.
In Sonar PHP 0.3, user have now the ability to extends rules profile by defining new profiles, and additionnel rulesets can be added through the extensions directory.
Hi,
The "plugin_name" columns of the "rules" table == "PHP Language".
But the "keyForPlugin" returns "PHP_CodeSniffer"
Changing the value of the "keyForPlugin" fix the bug.
See the patch in attachment.
I also saw that the Unit test is not working for PhpCodeSniffer: I fixed it in the patch also.
But the test is not good: it uses the same constant as the class for assertion: so the test will pass for any value of the key.
Instead, the test should verify with the key of the constant PhpPlugin.KEY
The code need a serious cleanup about the constants:
Which one should we use: PhpPlugin.KEY? PhpPlugin.PHPMD_PLUGIN_KEY ? PhpPlugin.CODESNIFFER_PLUGIN_KEY ?
Why there is a duplicated key in PhpCheckStyleViolationXmlParser.KEY ? Why not using PhpPlugin.CODESNIFFER_PLUGIN_KEY ?
I understood that this plugin was splitted before: so it was normal to have several KEYs.
But now, it's only one plugin.
I don't understand that choice: the settings panel is very big now, and we can't organize rules by tools (PMD/PhpCodesniffer)
But I don't care: it the choice was to merge in only one plugin, so it should use only one KEY: PhpPlugin.KEY.
That's what I did, and it fix also the bug.
This is a proper example. The issue is still present in HEAD and for 2.1.2 version