Integration with TeamCity
IntelliJ IDEA tightly integrates with TeamCity — a server-based web application that allows development teams to continuously incorporate changes to the project code base, run distributed builds and tests, and thoroughly check and improve the code base quality.
The integration plugin for IntelliJ IDEA is bundled with TeamCity and can be downloaded from My Settings and Tools page.
After installing the plugin you get access to a number of unique features:
- pre-tested (delayed commit)
- review of server-side code duplicates and code analysis reports within IDE
- stay up-to-date and monitor the status builds which are run on TeamCity
- view failed tests and real-time build logs
- take responsibility for the build failure
As a result of the smooth adoption of supported agile development and continuous integration practices and cutting-edge technologies, the developers have faster feedback cycles and the time for delivery of professional quality software is drastically shortened.
Pre-tested (delayed) Commit
Using the IntelliJ IDEA plugin for TeamCity you get a brand-new scenario of submitting developers' code changes to the version control with a unique Pre-tested (Delayed) commit feature. Compared with a standard edit-commit-modify scenario your changes are verified on TeamCity server BEFORE commit to the VCS. If the tests are successful, the commit is performed AUTOMATICALLY. Otherwise, you are notified on tests failure by one of the notification means and can fix the discovered issues. Your team is not affected and can continue working.
The pre-tested commit allows the developers work the way they prefer and make the code-test-release process almost as natural as breathing at the same time greatly reducing the frequency and impact of broken builds.
Server-side Code Analysis and Duplicates Search
Any development team wants to make the code base controlled during the whole project lifecycle. But the problem is that searching for code duplicates and analyzing the code quality locally is always a time-consuming operation which slows the developers' machines and distracts from the development process. TeamCity provides a server-based variation of means for maintaining the code quality:
- search for duplicated pieces of code for Java projects
- code inspection using more than 600 IntelliJ IDEA's inspections
- analysis of Java code covered by Unit tests
The duplicates and inspections reports on discovered issues are loaded right into IntelliJ IDEA, and you can use its means of working with inspections and duplicates – dedicated tool windows, quick-fixes, and highlighting in the editor.
Analyzing the code quality
With server-side code inspection the whole codebase is tested as often as you need. All the developers' changes integrated into the codebase are checked to make sure that they conform to coding standards and guidelines. Besides, TeamCity detects probable bugs, pieces of "dead" code, performance issues and supports many technologies including EJB, JSP, and JSF.
After installing IntelliJ IDEA plugin for TeamCity the server-side inspection results are downloaded into IntelliJ IDEA. Then you can view the inspection results highlighted in the editor and apply quick-fixes (solutions for discovered problems) or work with inspection results in a tool window. It's up to you and depends on your IntelliJ IDEA working habits. Besides, you can download and view only new inspection results that appeared since the last build was created.
Searching for Code Duplicates
The redundant pieces of code may eventually lead to an unmanageable project code base. With TeamCity all of the team members have access to the duplicates report and make the code base transparent, better structured and controlled day-by-day:
- choose whether to search or ignore the duplicates in the test sources of your project,
- regard usages of different variables, fields, methods, types, or literals in otherwise structurally similar code as duplicates,
- set the minimum relative size/complexity of a code piece to be regarded as a duplicate
To have the duplicate reports available in IntelliJ IDEA, you need to download and install the integration plugin. After that you can work with discovered code duplicates in a tool window and the duplicated code is highlighted in the editor.
View the examples of the server-size code duplicates reports at TeamCity demo site.