SonarQube PHP
  1. SonarQube PHP
  2. SONARPHP-221

The use of "-Dsonar.dynamicAnalysis=false" standard parameter should deactivate the execution of PHP_Unit

    Details

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

      Description

      Otherwise there is no way to deactivate PHP_unit and if the PHP project doesn't use PHP_Unit, the sonar analysis fails.

        Activity

        Hide
        Akram Ben Aissi added a comment - - edited

        Each sub plugin of the sonar php plugin can be disactived by adding the corresponding property:
        <sonar.phpUnit.shouldRun>false</sonar.phpUnit.shouldRun>
        <sonar.phpPmd.shouldRun>false</sonar.phpPmd.shouldRun>
        <sonar.phpCodesniffer.shouldRun>false</sonar.phpCodesniffer.shouldRun>
        <sonar.phpDepend.shouldRun>false</sonar.phpDepend.shouldRun>

        Sonar documentation says:
        Dynamic analysis relates to unit tests execution. By default, those unit tests are executed but you can optionally decide to do only static analysis or to reuse existing unit tests reports.

        is it really supposed to disactivate the unit tests plugin?
        or should it have to make the phpunit use existing phpunit.xml file if exist ?

        Show
        Akram Ben Aissi added a comment - - edited Each sub plugin of the sonar php plugin can be disactived by adding the corresponding property: <sonar.phpUnit.shouldRun>false</sonar.phpUnit.shouldRun> <sonar.phpPmd.shouldRun>false</sonar.phpPmd.shouldRun> <sonar.phpCodesniffer.shouldRun>false</sonar.phpCodesniffer.shouldRun> <sonar.phpDepend.shouldRun>false</sonar.phpDepend.shouldRun> Sonar documentation says: Dynamic analysis relates to unit tests execution. By default, those unit tests are executed but you can optionally decide to do only static analysis or to reuse existing unit tests reports. is it really supposed to disactivate the unit tests plugin? or should it have to make the phpunit use existing phpunit.xml file if exist ?
        Hide
        Frédéric Leroy added a comment -

        Yes standard property sonar.dynamicAnalysis is supposed to desactivate execution of the phpunit plugin

        Show
        Frédéric Leroy added a comment - Yes standard property sonar.dynamicAnalysis is supposed to desactivate execution of the phpunit plugin
        Hide
        Akram Ben Aissi added a comment -

        Enable static anaylisis if analyze only is set to true or dynamic analysis is set to false

        Show
        Akram Ben Aissi added a comment - Enable static anaylisis if analyze only is set to true or dynamic analysis is set to false

          People

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

            Dates

            • Created:
              Updated:
              Resolved: