SonarQube PHP
  1. SonarQube PHP
  2. SONARPHP-184

Add properties for existing php codesniffer and phpmd rules

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.3
    • Fix Version/s: 0.6
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      internal rules.xml for codesniffer or phpmd must be updated with the following example:

      <rule key="Generic.Files.LineEndings.InvalidEOLChar" priority="MAJOR">
          <category name="Maintainability"/>
          <name>LineEndingsInvalidEOLChar</name>
          <configKey>rulesets/LineEndings</configKey>
          <description><![CDATA[End of line character is invalid; expected "%s" but found "%s]]></description>
          <param>
            <key>eolChar</key>
            <description>End of line character</description>
            <defaultValue><![CDATA[\n]]></defaultValue>
          </param>
        </rule>
      

      You can have multiple <param> tags for a rule.

      For the moment, it's a long time job. However, user can override the internal configuration with its own by following steps on this page:
      http://docs.codehaus.org/display/SONAR/Extend+coding+rules

        Issue Links

          Activity

          Hide
          Fabrice Bellingard added a comment -

          PHPMD repository has already been cleaned up and improved, the big work is now on the PHPCS rule repository.

          Show
          Fabrice Bellingard added a comment - PHPMD repository has already been cleaned up and improved, the big work is now on the PHPCS rule repository.
          Hide
          Gabriele Santini added a comment -

          All possible properties for existing PHPCS rules have already been added and with the hack described elsewhere it is possible to let PHPCS use them. So I propose to close this ticket and eventually open more precise issues for phpcs integration for 0.7

          Show
          Gabriele Santini added a comment - All possible properties for existing PHPCS rules have already been added and with the hack described elsewhere it is possible to let PHPCS use them. So I propose to close this ticket and eventually open more precise issues for phpcs integration for 0.7

            People

            • Assignee:
              Fabrice Bellingard
              Reporter:
              Akram Ben Aissi
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: