SonarQube PHP
  1. SonarQube PHP
  2. SONARPHP-236

Handle PHP source code exclusions in a single place, whatever the tool is

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Source code exclusions should be managed in a single place: the "sonar.exclusions" property.

        Issue Links

          Activity

          Hide
          Akram Ben Aissi added a comment -

          At first, we have planned to use custom properties in pom.xml to handle these exclusions.
          So we had 4 different properties, one for each tool (pdepend, pmd, punit and codesniffer) to manage exclusions per tool.

          Frederic, Gabriele and others: Do you think that we should maintain these features?
          Otherwise, we can rely on the sonar.exclusions property.

          Please comment.

          Show
          Akram Ben Aissi added a comment - At first, we have planned to use custom properties in pom.xml to handle these exclusions. So we had 4 different properties, one for each tool (pdepend, pmd, punit and codesniffer) to manage exclusions per tool. Frederic, Gabriele and others: Do you think that we should maintain these features? Otherwise, we can rely on the sonar.exclusions property. Please comment.
          Hide
          Gabriele Santini added a comment -

          The best thing would be to have a cascading configuration system : if exclusion is configured at project level it is automatically ported to each tool but you can still make exceptions for an individual tool

          Show
          Gabriele Santini added a comment - The best thing would be to have a cascading configuration system : if exclusion is configured at project level it is automatically ported to each tool but you can still make exceptions for an individual tool
          Hide
          Fabrice Bellingard added a comment -

          IMO, we should only rely on the standard "sonar.exclusions" property and not define any new property, as this is handled for any other supported language in the Sonar platform.
          If we start defining specific exclusion properties for each tool, this will generate discrepancies in the results of the analysed projects (why file A should be analysed by PHP CodeSniffer and not PHPMD, and file B the contrary?).

          Show
          Fabrice Bellingard added a comment - IMO, we should only rely on the standard "sonar.exclusions" property and not define any new property, as this is handled for any other supported language in the Sonar platform. If we start defining specific exclusion properties for each tool, this will generate discrepancies in the results of the analysed projects (why file A should be analysed by PHP CodeSniffer and not PHPMD, and file B the contrary?).
          Hide
          Freddy Mallet added a comment -

          I fully agree Fabrice, this will be a mistake to handle such exclusions by tool.

          Show
          Freddy Mallet added a comment - I fully agree Fabrice, this will be a mistake to handle such exclusions by tool.
          Hide
          Fabrice Bellingard added a comment -

          Actually, there is a real need, besides the fact that exclusions must be handled only via the standard "sonar.exclusions" parameter: we should try to map this parameter to each tool specific parameter, so that if someone defines an exclusion pattern to reduce the analysis time, each tool (PHPCS, PHPMD, ...) is aware of those exclusions (otherwise the analysis time of those tools won't be reduced).

          I'll work on that.

          Show
          Fabrice Bellingard added a comment - Actually, there is a real need, besides the fact that exclusions must be handled only via the standard "sonar.exclusions" parameter: we should try to map this parameter to each tool specific parameter, so that if someone defines an exclusion pattern to reduce the analysis time, each tool (PHPCS, PHPMD, ...) is aware of those exclusions (otherwise the analysis time of those tools won't be reduced). I'll work on that.
          Hide
          Fabrice Bellingard added a comment - - edited

          This is not possible to properly map "sonar.exclusions" to each tool specific switch (the pattern used in those switch is too much different from the one used by "sonar.exclusions").

          As a consequence, if someone really wants to exclude files for external tools (phpcs, pdepend, phpmd), then he should use the "sonar.xxxx.argumentLine" parameter to specify it. But our advise is to not use this feature.

          I have updated the documentation on the FAQ page: http://docs.codehaus.org/display/SONAR/PHP+plugin+FAQ#PHPpluginFAQ-Fileexclusions

          Show
          Fabrice Bellingard added a comment - - edited This is not possible to properly map "sonar.exclusions" to each tool specific switch (the pattern used in those switch is too much different from the one used by "sonar.exclusions"). As a consequence, if someone really wants to exclude files for external tools (phpcs, pdepend, phpmd), then he should use the "sonar.xxxx.argumentLine" parameter to specify it. But our advise is to not use this feature. I have updated the documentation on the FAQ page: http://docs.codehaus.org/display/SONAR/PHP+plugin+FAQ#PHPpluginFAQ-Fileexclusions

            People

            • Assignee:
              Fabrice Bellingard
              Reporter:
              Olivier Gaudin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: