Skip to end of banner
Go to start of banner

Use static code analysis within Eclipse

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

You should already have set up your inspectIT development environment. On this page you already installed and configured all necessary tools that we use for static code analysis. This page shows you how you can use them (in a brief way).

FindBugs

  • Open the Findbugs "Bug Explorer" view (Window -> Show View -> Other -> FindBugs -> Bug Explorer)
  • Select the projects to check, right click and select "FindBugs -> Find Bugs" (note that this entry is above refresh in my Eclipse and not down in the list with Checkstyle and PMD)
  • Ensure that you addressed all violations prior to a pull request

 

Checkstyle

  • Open the Checkstyle "Violations Overview" view (Window -> Show View -> Other -> Checkstyle -> Checkstyle violations)

  • Select the projects you want to check, right-click and select "Checkstyle -> Check project"

  • The Checkstype violations view shows you all violations

  • Ensure that you have to violation prior to a pull request

PMD

Eclipse only shows the same errors if the pmd version is the same as in the build

Note that the Eclipse version (find this out via Window -> Preferences -> PMD (bottom)) needs to be the same as the pmd version used within the ant build (see common-targets in Commons at GitHub). Note that we always try to have the PMD version in the build to mirror the PMD version of Eclipse to sync the error messages. If your PMD version in eclipse is higher, create a ticket to update the PMD version within the build

 

  • Open the Checkstyle "Violations Overview" view (Window -> Show View -> Other -> PMD -> Violations Overview)

  • Select the projects you want to check, right-click and select "PMD -> Check project"

  • The PMD violations view shows you all violations

  • Ensure that you have to violation prior to a pull request

  • No labels