Interface SensorDescriptor


  • public interface SensorDescriptor
    Describe what a Sensor is doing. Information may be used by the platform to log interesting information or perform some optimization. See Sensor.describe(SensorDescriptor)
    Since:
    5.1
    • Method Detail

      • name

        SensorDescriptor name​(java.lang.String sensorName)
        Displayable name of the Sensor. Will be displayed in logs.
      • onlyOnLanguage

        SensorDescriptor onlyOnLanguage​(java.lang.String languageKey)
        Language this Sensor work on. Used by the platform to skip execution of the Sensor when no file for given languages are present in the project. Default is to execute sensor for all languages.
      • onlyOnLanguages

        SensorDescriptor onlyOnLanguages​(java.lang.String... languageKeys)
        List languages this Sensor work on. Used by the platform to skip execution of the Sensor when no file for given languages are present in the project. Default is to execute sensor for all languages.
      • onlyOnFileType

        SensorDescriptor onlyOnFileType​(InputFile.Type type)
        InputFile.Type this Sensor work on. Used by the platform to skip execution of the Sensor when no file for given type are present in the project. Default is to execute sensor whatever are the available file types.
      • createIssuesForRuleRepository

        SensorDescriptor createIssuesForRuleRepository​(java.lang.String... repositoryKey)
        Rule repository this Sensor create issues for. Used by the platform to skip execution of the Sensor when no rule is activated for the given repository.
      • createIssuesForRuleRepositories

        SensorDescriptor createIssuesForRuleRepositories​(java.lang.String... repositoryKeys)
        List rule repositories this Sensor create issues for. Used by the platform to skip execution of the Sensor when no rule is activated for the given repositories.
      • global

        @Deprecated
        SensorDescriptor global()
        Deprecated.
        since 7.6 change your Sensor to a ProjectSensor instead
        This sensor should be executed at the project level, instead of per-module.
        Since:
        6.4
      • onlyWhenConfiguration

        SensorDescriptor onlyWhenConfiguration​(java.util.function.Predicate<Configuration> predicate)
        Predicate that will be evaluated on current project Configuration by the platform to decide if execution of the Sensor should be skipped.
        Since:
        6.5
      • processesFilesIndependently

        SensorDescriptor processesFilesIndependently()
        Advertise that this sensor process each file independently. It means executing the sensor twice with FileSystem=[FileA] and FileSystem=[FileB] will produce the same result than executing the sensor only once with FileSystem=[FileA,FileB]. This will allow the platform to optimize sensor execution.
        Since:
        9.3
      • processesHiddenFiles

        SensorDescriptor processesHiddenFiles()
        Advertise that this sensor processes hidden files. By default, sensors will not receive hidden files, specifically where IndexedFile.isHidden() evaluates to true. If hidden file processing is activated, the sensor signals that it processes files where IndexedFile.isHidden() is true. Depending on the runtime context, the FileSystem will then supply additional hidden files to the sensor.
        Since:
        12.0