# Class CodeQualityExtension

java.lang.Object
org.gradle.api.plugins.quality.CodeQualityExtension

Direct Known Subclasses:
  `CheckstyleExtension, CodeNarcExtension, PmdExtension`

public abstract class CodeQualityExtension extends Object
Base Code Quality Extension.

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CodeQualityExtension()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract ObjectFactory`
  `getObjectFactory()`
  `File`
  `getReportsDir()`
  The directory where reports will be generated.
  `abstract DirectoryProperty`
  `getReportsDirectory()`
  The directory where reports will be generated.
  `Collection<SourceSet>`
  `getSourceSets()`
  The source sets to be analyzed as part of the `check` and `build` tasks.
  `String`
  `getToolVersion()`
  The version of the code quality tool to be used.
  `boolean`
  `isIgnoreFailures()`
  Whether to allow the build to continue if there are warnings.
  `void`
  `setIgnoreFailures(boolean ignoreFailures)`
  Whether to allow the build to continue if there are warnings.
  `void`
  `setReportsDir(File reportsDir)`
  Sets the directory where reports will be generated.
  `void`
  `setSourceSets(Collection<SourceSet> sourceSets)`
  The source sets to be analyzed as part of the `check` and `build` tasks.
  `void`
  `setToolVersion(String toolVersion)`
  The version of the code quality tool to be used.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CodeQualityExtension

    public CodeQualityExtension()

- ## Method Details

  - ### getToolVersion

    public String getToolVersion()
    The version of the code quality tool to be used.
    Since:
      1.0

  - ### setToolVersion

    public void setToolVersion(String toolVersion)
    The version of the code quality tool to be used.
    Since:
      1.0

  - ### getSourceSets

    public Collection<SourceSet> getSourceSets()
    The source sets to be analyzed as part of the `check` and `build` tasks.
    Since:
      1.0

  - ### setSourceSets

    public void setSourceSets(Collection<SourceSet> sourceSets)
    The source sets to be analyzed as part of the `check` and `build` tasks.
    Since:
      1.0

  - ### isIgnoreFailures

    public boolean isIgnoreFailures()
    Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true
    Since:
      1.0

  - ### setIgnoreFailures

    public void setIgnoreFailures(boolean ignoreFailures)
    Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true
    Since:
      1.0

  - ### getReportsDirectory

    @Incubating public abstract DirectoryProperty getReportsDirectory()
    The directory where reports will be generated.
    Since:
      9.7.0

  - ### getReportsDir

    @ReplacedBy("reportsDirectory") public File getReportsDir()
    The directory where reports will be generated.
    Since:
      1.0

  - ### setReportsDir

    public void setReportsDir(File reportsDir)
    Sets the directory where reports will be generated.
    Since:
      1.0

  - ### getObjectFactory

    @Inject protected abstract ObjectFactory getObjectFactory()