.deepsource.toml
configuration specific to the java
analyzer. Please make sure to read the general configuration guide first.
The Java analyzer supports Gradle, Maven and Bazel projects. There is no difference in configuration between them, and all types of projects can be initialized through the simple workflow of the DeepSource configuration generator.
name
enabled
meta
runtime_version
java_version
runtime_version
is not specified, or is the wrong Java version, analysis may show incorrect results. Specify the Java version you use in CI for best results.skip_doc_coverage
test
, class
, constructor
and nonpublic
test
- Ignore documentation coverage within testsclass
- Ignore class documentation coverageconstructor
- Ignore constructor documentation coveragenonpublic
- Ignore documentation coverage for any declaration not marked as public
[ "test" ]
skip_doc_coverage
is set, it will override any default configuration. That is, if this key is set, and you wish to ensure documentation coverage is skipped for elements that are skipped by default (like tests), you must specify those as well as the additional elements you wish to skip.cyclomatic_complexity_threshold
low
will flag all functions that have a cyclomatic complexity of more than 5
, while setting the threshold to critical
will not flag any function.low
, medium
, high
, very-high
and critical
Risk category | Cyclomatic complexity range | Recommended action |
---|---|---|
low | 1-5 | No action is needed. |
medium | 6-15 | Review and monitor. |
high | 16-25 | Review and refactor. Recommended to add detailed comments if the function absolutely needs to be kept as it is. |
very-high | 26-50 | Refactor to reduce the complexity. |
critical | >50 | Must refactor this. This can make the code untestable and very difficult to understand. |
medium
pom.xml
file, you should be able to run tests and generate the coverage report. The default location of the coverage report is target/site/jacoco/jacoco.xml
.
jacoco:report-aggregate
goal to merge all reports together.
After you have the XML test report, you can upload it to DeepSource using the cli:
pom.xml
file, you will be able to instrument and run tests:
target/site/clover/clover.xml
.
After you have the XML test report, you can upload it to DeepSource using the cli:
google-java-format
.deepsource.toml
configuration specific to the google-java-format
transformer. Please make sure to read the general configuration guide first.
pom.xml
(Maven)buildscript-gradle.lockfile
(Gradle)gradle.lockfile
(Gradle)