Skip to content

Commit 0a78e89

Browse files
Update complexity definition (#2369)
* Update Lizard Doc * Update complexity definition * update-complexity-definition
1 parent c9e07e6 commit 0a78e89

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/faq/code-analysis/which-metrics-does-codacy-calculate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ Codacy uses [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_com
8080

8181
Codacy calculates complexity as follows:
8282

83-
- The complexity value for each file is the highest cyclomatic complexity of the methods in the file.
83+
- The complexity value of a file is the total sum of the cyclomatic complexities of all methods within it.
8484
- A file is considered complex if its cyclomatic complexity value is higher than the threshold [**File is complex when over**](../../repositories-configure/adjusting-quality-goals.md).
85-
- The complexity value of a commit or pull request is the sum of the cyclomatic complexity of the files that were changed in the commit or pull request and that have a high complexity increase, defined as an increase of 4 or more.
85+
- The complexity value of a commit or pull request is determined by the cyclomatic complexity of its changes.
8686

8787
Codacy displays complexity on the following places:
8888

docs/repositories/commits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ The **Duplication** tab displays the lists of clones (duplicated code blocks) th
111111
The **Complexity** tab displays the complexity changes introduced by the {{ page.meta.page_name }}. Use the sidebar filters to filter the list by high increase (4 or more), low increase (1 to 3), or improvement (less than 0).
112112

113113
!!! note
114-
When calculating the complexity variation introduced by a {{ page.meta.page_name }}, Codacy only considers files with a high increase in complexity. For more information, see [how Codacy calculates cyclomatic complexity](../faq/code-analysis/which-metrics-does-codacy-calculate.md#complexity).
114+
For more information, see [how Codacy calculates cyclomatic complexity](../faq/code-analysis/which-metrics-does-codacy-calculate.md#complexity).
115115

116116
![Complexity tab](./images/{{ page.meta.file_name }}-tab-complexity.png)
117117

0 commit comments

Comments
 (0)