sbt findbugs
v2.0.0
이 SBT 플러그인을 사용하면 Great FindBugs 도구를 사용하여 (Java) 코드를 분석 할 수 있습니다. 해당 목적으로 findbugs SBT 조치를 정의합니다.
project/plugins.sbt 에 다음을 추가하여 플러그인을 설치하십시오.
addSbtPlugin( " com.github.sbt " % " sbt-findbugs " % " <version> " ) 그런 다음 sbt findbugs 로 플러그인을 실행하십시오. 이렇게하면 target/scala-xx/findugs/report.xml 에서 FindBugs 보고서가 생성됩니다.
예를 들어 설정에 Scala Inline XML을 사용하십시오.
findbugsIncludeFilters := Some (< FindBugsFilter >
< Match >
< Class name = " de.johoop.Meep " />
</ Match >
</ FindBugsFilter >)보다 일반적인 방식으로 파일의 필터 설정을 읽을 수도 있습니다.
findbugsIncludeFilters := Some (baseDirectory.value / " findbugs-include-filters.xml " )또는 구성이 지정되어 있으며 이전에 로컬 리포에 게시 될 때 :
findbugsIncludeFilters := {
val configFiles = update.value.select(module = moduleFilter(name = " velvetant-sonar " ))
val configFile = configFiles.headOption flatMap { zippedFile =>
IO .unzip(zippedFile, target.value / " rules " ) find (_.name contains " velvetant-sonar-findbugs.xml " )
}
configFile map scala.xml. XML .loadFile orElse sys.error( " unable to find config file in update report " )
}(FindBugs 문서도 참조)
findbugsReportTypeSome(FindbugsReportType.{Xml, Html, PlainHtml, FancyHtml, FancyHistHtml, Emacs, Xdoc})Some(FindbugsReportType.Xml)findbugsReportPathSome(crossTarget.value / "findbugs" / "report.xml")findbugsPriorityFindbugsPriority.{Relaxed, Low, Medium, High}FindbugsPriority.MediumfindbugsEffortFindbugsEffort.{Minimum, Default, Maximum}FindbugsEffort.DefaultfindbugsOnlyAnalyzeList[String] 포함 된 옵션.None (의미 : 모든 것을 분석).findbugsMaxMemory1024findbugsAnalyzeNestedArchivestrue 과 falsetruefindbugsSortReportByClassNamestrue 과 falsefalsefindbugsIncludeFiltersNone 및 Option[Node]None (필터 포함).findbugsExcludeFiltersNone 과 Some[Node]None (필터 제외 없음).findbugsAnalyzedPathsbt.PathSeq(classDirectory in Compile value) 그들의 기여에 대한 @asflierl과 @anishathalye 덕분에!
저작권 (c) Joachim Hofer & 기고자
모든 권리 보유.
이 프로그램과 함께 제공되는 자료는이 배포와 함께 제공되는 Eclipse Public License v1.0 의 조건에 따라 제공되며 http://www.eclipse.org/legal/epl-v10.html에서 제공됩니다.