Skip to content

Update docs complexity #2440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Codacy calculates the number of issues in the following static code analysis cat
<!--issue-categories-start-->
- **Code style:** Code formatting and syntax problems, such as variable names style and enforcing the use of brackets and quotation marks
- **Error prone:** Code that may hide bugs and language keywords that should be used with caution, such as the operator `==` in JavaScript or `Option.get` in Scala
- **Code complexity:** High complexity methods and classes that should be refactored
- **Code complexity:** High complexity files that should be refactored
- **Performance:** Code that can have performance problems
- **Compatibility:** Mainly for frontend code, compatibility problems across different browser versions
- **Unused code:** Unused variables and methods, code that can't be reached
Expand Down Expand Up @@ -88,8 +88,8 @@ Codacy displays complexity on the following places:

|Place|Metric|
|-----|------|
|[Commit detail page](../../repositories/commits.md)<br/>[Pull request detail page](../../repositories/pull-requests.md)<br/>[Email notifications](../../account/emails.md#managing-your-email-notifications)|Variation of the complexity value introduced by the commit or pull request|
|[Files page](../../repositories/files.md)|Complexity value of each file|
|[Commit detail page](../../repositories/commits.md)<br/>[Pull request detail page](../../repositories/pull-requests.md)<br/>[Email notifications](../../account/emails.md#managing-your-email-notifications)|The complexity variation introduced by a commit or pull request is defined as the sum of the changes in code complexity for each file modified in the commit or pull request|
|[Files page](../../repositories/files.md)|The file complexity value is the sum of the complexity values of all methods defined within the file|
|[Repository Dashboard](../../repositories/repository-dashboard.md)|Percentage of complex files in your repository and how the metric is evolving over time|
|[Organization overview](../../organizations/organization-overview.md)|Average percentage of complex files in the repositories in your organization and percentage of complex files in each repository|
|[Repositories list page](../../organizations/managing-repositories.md)|Percentage of complex files in each repository in your organization|
Expand Down
26 changes: 25 additions & 1 deletion docs/repositories-configure/codacy-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Codacy supports configuring certain advanced features through a configuration file, such as:

- [Ignoring files](#ignore-files) globally, for duplication, or a specific tool
- [Ignoring files](#ignore-files) globally, for duplication, for cyclomatic complexity, or a specific tool

- [Including specific ignored files](#include-files) in the analysis

Expand Down Expand Up @@ -50,6 +50,12 @@
config:
languages:
- "ruby"
metric:
exclude_paths:
- "src/test.ts"
config:
languages:
- "typescript"
languages:
css:
extensions:
Expand Down Expand Up @@ -101,6 +107,24 @@
- "**/*.resource"
```

### Syntax for configuring cyclomatic complexity

Cyclomatic complexity can be disabled or partially ignored for certain paths, files or languages.

Check warning on line 112 in docs/repositories-configure/codacy-configuration-file.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Microsoft.Adverbs] Consider removing 'partially'. Raw Output: {"message": "[Microsoft.Adverbs] Consider removing 'partially'.", "location": {"path": "docs/repositories-configure/codacy-configuration-file.md", "range": {"start": {"line": 112, "column": 42}}}, "severity": "WARNING"}

!!! note
Cyclomatic complexity is referred as `metric` in the configuration file.

```yaml
---
engines:
metric:
exclude_paths:
- "src/test.ts"
config:
languages:
- "typescript"
```

## Including specific files using a Codacy configuration file {: id="include-files"}

The Codacy configuration file allows you to explicitly specify files or directories to include in the analysis. This is particularly useful for [bypassing files or directories that are ignored by default](./ignoring-files.md#default-ignored-files) or specified in `exclude_paths`.
Expand Down
Loading