Code Quality
With TeamCity's numerous code quality features you can be sure your code base is being thoroughly tested from the project's start helping you develop high caliber software.
Code Coverage, Inspections and Duplicates Search
TeamCity has an unparalleled variation of means for maintaining code quality:
- Analysis of Java code covered by unit tests
Measure the code coverage for your unit tests with EMMA, an open-source toolkit. TeamCity provides both summaries and detailed reports on code coverage. You can also download the code coverage results and analyze them in IntelliJ IDEA.
The coverage statistics is available for projects using Ant and Ipr build runners.
You can track your projects' classes, blocks, lines and methods covered by the tests using the code coverage statistical graph. - Search for duplicated pieces of code for Java and .NET projects
Manually searching for code duplicates in big projects locally can take huge amounts of time, and it is almost impossible to constantly monitor the state of the code base.
TeamCity's solution is automated searching for code duplicates in .Net and Java code just like running a build. Select one of the Duplicates Finder runners and all of the integrated code is constantly checked for duplicates. The search is performed on a Build Agent and detailed reports are available in the web UI, where you can opt to show all or only newly discovered duplicates. The Duplicates Finder for Java is powered by IntelliJ IDEA and will catch repetitive blocks of Java code in IntelliJ IDEA projects or projects being built by Maven2.

TeamCity now integrates with FxCop runner for .NET projects code analysis.

The .NET Duplicates Finder is based on ReSharper's capabilities and will catch similar code fragments of your C# and Visual Basic .NET code in Visual Studio 2003, 2005 and 2008 solutions. TeamCity supports C# up to version 2.0 and covers Visual Basic .NET up to version 8.0.
A statistical graph allows you to track the number of duplicates discovered in your code.
Search for Java inspections and duplicates are now powered by IntelliJ IDEA 8.0.
- Server-side code inspection of Java, JSP, JavaScript, CSS code
TeamCity uses a set of more than 600 IntelliJ IDEA's inspections which you can use to analyze:
- unused and unreachable code,
- declaration redundancies,
- performance issues,
- dead code.
Check out the results of your code analysis in a browser, and then navigate to a particular string of code in the IDE where you can suppress or resolve the inspection results.
Code inspection is available for Maven2 projects.
Tests Re-ordering for Risk Group Tests and Test Details
TeamCity now identifies a set of tests which are likely to fail, and can run those tests first on the next build, allowing you to confirm potential fixes sooner thus reducing the feedback time.
You can choose to:
- run newly added and modified tests first (available with JUnit, TestNG using Ant/Ipr build runners)
- run recently failed tests first (available with JUnit, TestNG using Ant/Ipr build runners, and with NUnit using any .NET runner)
Tests reporting UI improvements:
- New Problematic Tests tab, showing tests which have failed recently, total number of test runs, failure rate, and other related information.
- New Test Details page, containing complete information and duration trend chart for a particular test.
- Tests tab improvements: Tests sorting, information on total duration for the filtered tests.
Statistics
With statistical trends you can track the condition of your projects over time. The visual graphs include information about all the builds of a certain build configuration across all its history. You can:
- Select time range for each type of statistics
- Filter information by data series, for example, by Agent name or by result type
- View average values
- Filter out failed builds and show only the successful builds
- View a build summary information and navigate to the build results page
"Time to fix tests" Statistics
A new type of statistical data display: time it took to fix the build's tests.

Test Count
This chart displays the number of tests (JUnit, NUnit, TestNG) that the build passed, ignored, or failed.
Duplicates, Inspections, and Coverage Charts
For those build configurations which have duplicates, inspections or coverage enabled, you can analyze the trends in:
- the amount of duplicated code
- the number of errors and warning found
- the number of unit tests

