Skip to main content

Cyclopt Configuration File

Cyclopt provides a configuration file, which allows you to configure some parameters that are taken into consideration while your code is analyzed. This can be done by adding a cyclopt.yaml file in the root directory.

Template

You can edit the configuration file, based on the template below:

cyclopt.yaml
global:
branches_exclude:
- testing_branch
metrics:
exclude:
- /pilots/*
- /src/models/*
- /src/routes/public.js
violations:
exclude:
- Position Literals First In Comparisons
files_ignore:
- /tests/*
modules:
- path: "/tests"
languages:
- Java
metrics:
exclude:
- /data/*
include:
- /pilots/*
violations:
include:
- Position Literals First In Comparisons
exclude:
- Loose Coupling
files_ignore:
- /src/*
files_include:
- /tests/*

Instructions

Global

In global section, the settings that apply to the whole repository are set.

In this section you may configure the following:

  1. Specific branches can be excluded from the analysis by adding them in branches_exclude.

  2. You can exclude some files or subdirectories from the metrics analysis. These files/subdirectories will not be taken into account while calculating the metrics.

  3. Moreover, you can exclude some violations from the analysis by adding their name under violations.exclude, as it appears in the Violations page in Cyclopt platform (e.g. Position Literals First In Comparisons as shown in the image below):

img

  1. It is also feasible to exclude some files or folders from the violations analysis by adding them under the violations.files_ignore section. You may also provide some globby patterns, which will be used to identify the files of folders to be excluded from the analysis.

Modules

In modules section, the settings that apply to the specific root that is defined by the path argument are set. It should be noted that all the settings from the global section apply to this module/root as well.

In this section you may configure the following:

  1. You may specify the languages to be analyzed (in case they differ from the ones of the repository).

  2. In violations section, you may perform the same actions as in the global.violations section.

  3. Additionally, it is possible to include some violations in the analysis of this module/root that were previously excluded globally in global.violations.exclude.

  4. Finally, you may also include some files, folders or globby patterns (in the files_include section) that were also excluded in global.violations.files_ignore.

  5. Respectively, in metrics sections, you may perform the same actions as in the modules.violations. You can add the the subfolders that you want to exlude for the specific module/root metrics.exclude and the subfolders that you want to include for the specific module/root in metrics.include.


Copyright © 2022 Cyclopt