Skip to main content
Skip table of contents

Migrating Static Analyzers

Static analyzers executed on Bitbucket are deprecated as of app version 5.0.

For migration, follow the guide below to move onto the newer CI log based analysis.

Migration Example: PMD

Before app version 5.x, static analyzers were executed on Bitbucket.
Now, you have to execute them during your CI build:

  1. Run PMD as part of your CI build.

    1. Download and install PMD to use on your CI server. Or use a PMD plugin for your build system, like Maven or Gradle

    2. Run the PMD as part of the build for every pull request. See the configuration for Bamboo.

    3. The print the PMD results to the build log. Either by using the --format xml flag or by printing the report XML, like cat ./target/pmd.xml

  2. Configure and enable the log analysis.

  3. Ensure the log analysis reports the PMD warnings as you expect in your pull request as code insight annotations.

  4. Disable the deprecated built-in PMD analyzer, as you get the results duplicated otherwise.

Migrate Other Analyzers

  1. Checkout all supported analyzers.

  2. For analyzers not listed there, you can still use them if they support the

    Checkstyle output format.

  3. For other analyzers, tell us what you use. We will help you with the migration.

Reason for Deprecating Static Analyzers

The running static Analyzers on Bitbucket itself has inherent issues:

  • Bitbucket 8 changed its internal Git APIs to support Bitbucket Mesh. Supporting it would make the performance event more unpredictable, as the Git repos might be remote to where the analyzers run. On Bitbucket 8 the static analyzers are not supported anymore.

  • Bitbucket servers are not configured to run tools in the background. This results in issues like Bitbucket running out of disk space, due to checked-out working directories. Or Bitbucket being slow due to the extra work etc.

  • The CI server has better infrastructure to run analyzers than Bitbucket. The CI server is set up to run arbitrary builds, including analyzer steps. It has facilities to clean up disk space, is expected to have build tools installed, and it can distribute work across build agents.

  • Running Analyzers on Bitbucket is not compatible with a multi node Data Center setup. Multiple Bitbucket nodes would need to coordinate to run the analyzer only once and distribute the load between different nodes. The CI server already solves this issue.

Therefore, we decided that running the Analyzers on the CI system and showing the results in Bitbucket is the better way going forward.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.