# How to Create a Project
To run Teamscale on your code, two steps are required: First, you have to create an analysis profile which configures the analyses that should be run and all their options. Second, you need a project configuration which configures the scope of the analyzed code. Both steps can be done in the Projects perspective.
# Best Practices for Your Own Teamscale Project
Before you jump into configuring your first Teamscale project, here are some best practices for first-time users:
# Start with the Default Analysis Profile Best Practice
Configuring an analysis profile in all its details can be a daunting task. Teamscale offers hundreds of checks and options that let you customize it fully to your needs. However, when you're setting up your very first project, it makes more sense to start with some sane defaults and then later refine the settings step-by-step. To this end, Teamscale provides a default analysis profile for each supported language.
Build on defaults
We recommend you start with the default analysis profile for your language and later, step-by-step, refine it to your needs.
# Limit the Amount of History you Analyze Best Practice
Teamscale’s incremental analysis engine allows it to give you instant feedback on each of your commits. Analyzing the changes in a single commit usually only takes a few seconds. If your project has a long history, analyzing that entire history will, of course, take some time. The longer the history, the longer it takes. When you’re setting up your first Teamscale project, you will usually want to make several smaller changes in short order, e.g., to the analysis profile or the included/excluded files.
Thus, it makes sense to start with a very short history (e.g the last few days) while you’re still working on fine-tuning the configuration. Once you’re satisfied with the results, reanalyze the project with a longer history.
To limit the amount of history that Teamscale will analyze, change the
Start revision parameter of your repository connector.
# Exclude Generated/Third-Party Code Best Practice
Many software projects make use of code generators, e.g., to generate UI components or data classes. Generated code is often repetitive and usually doesn’t conform to your company’s coding guidelines. Furthermore, you should never make changes to the generated code directly. Thus, for most analyses, it makes no sense to check your generated code with Teamscale. We recommend that you use the include and exclude patterns of the connector configuration to exclude all generated code from the analysis.
Excluding code from analysis
To exclude code, add a pattern to the
Excluded file names parameter of your repository connector.
Analyzing generated code on purpose
If you really want to run certain checks on your generated code (e.g., security analyses), we recommend you create a separate Teamscale project for it plus a special analysis profile with only those checks enabled.
# Creating an Analysis Profile
A detail guide on how to create or edit an analysis can be found here.
# Creating the Project
On the Project Configuration perspective, you can see a list of all projects configured in Teamscale.
To create a new project, select
New project button at the top. You will be taken to the
project creation screen:
Here, you can enter the name of your project and select the analysis profile.
Next, you can add any number of source code repositories and issue trackers. To do so, select the correct repository or issue tracker type from the corresponding drop-down. A new section will appear where you can configure all options needed to connect to the repository or issue tracker, e.g. credentials, starting revision, files to exclude, etc.:
The options are explained in more detail here.
Most connectors require you to specify an account that holds shared credentials (user name, password). While any user with sufficient rights to create new projects may also create new accounts, only the system administrator may edit or delete existing external accounts in the Admin perspective.
You may use
Validate (bottom left) to make sure your settings are correct before clicking
Create Project to start the analysis. To
monitor analysis progress you can have a look at the System or Activity perspective.