You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/faq/code-analysis/which-metrics-does-codacy-calculate.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Codacy calculates the number of issues in the following static code analysis cat
51
51
<!--issue-categories-start-->
52
52
-**Code style:** Code formatting and syntax problems, such as variable names style and enforcing the use of brackets and quotation marks
53
53
-**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
54
-
-**Code complexity:** High complexity methods and classes that should be refactored
54
+
-**Code complexity:** High complexity files that should be refactored
55
55
-**Performance:** Code that can have performance problems
56
56
-**Compatibility:** Mainly for frontend code, compatibility problems across different browser versions
57
57
-**Unused code:** Unused variables and methods, code that can't be reached
@@ -88,8 +88,8 @@ Codacy displays complexity on the following places:
88
88
89
89
|Place|Metric|
90
90
|-----|------|
91
-
|[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|
92
-
|[Files page](../../repositories/files.md)|Complexity value of each file|
91
+
|[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|
92
+
|[Files page](../../repositories/files.md)|The file complexity value is the sum of the complexity values of all methods defined within the file|
93
93
|[Repository Dashboard](../../repositories/repository-dashboard.md)|Percentage of complex files in your repository and how the metric is evolving over time|
94
94
|[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|
95
95
|[Repositories list page](../../organizations/managing-repositories.md)|Percentage of complex files in each repository in your organization|
Copy file name to clipboardExpand all lines: docs/repositories-configure/codacy-configuration-file.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: Use the Codacy configuration file to configure advanced features on
6
6
7
7
Codacy supports configuring certain advanced features through a configuration file, such as:
8
8
9
-
-[Ignoring files](#ignore-files) globally, for duplication, or a specific tool
9
+
-[Ignoring files](#ignore-files) globally, for duplication, for cyclomatic complexity, or a specific tool
10
10
11
11
-[Including specific ignored files](#include-files) in the analysis
12
12
@@ -50,6 +50,12 @@ To use a Codacy configuration file:
50
50
config:
51
51
languages:
52
52
- "ruby"
53
+
metric:
54
+
exclude_paths:
55
+
- "src/test.ts"
56
+
config:
57
+
languages:
58
+
- "typescript"
53
59
languages:
54
60
css:
55
61
extensions:
@@ -101,6 +107,24 @@ exclude_paths:
101
107
- "**/*.resource"
102
108
```
103
109
110
+
### Syntax for configuring cyclomatic complexity
111
+
112
+
Cyclomatic complexity can be disabled or partially ignored for certain paths, files or languages.
113
+
114
+
!!! note
115
+
Cyclomatic complexity is referred as `metric` in the configuration file.
116
+
117
+
```yaml
118
+
---
119
+
engines:
120
+
metric:
121
+
exclude_paths:
122
+
- "src/test.ts"
123
+
config:
124
+
languages:
125
+
- "typescript"
126
+
```
127
+
104
128
## Including specific files using a Codacy configuration file {: id="include-files"}
105
129
106
130
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`.
0 commit comments