Skip to content
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

MCC name is incorrect #3456

Open
Nereboss opened this issue Dec 21, 2023 · 8 comments · May be fixed by #3606
Open

MCC name is incorrect #3456

Nereboss opened this issue Dec 21, 2023 · 8 comments · May be fixed by #3606
Assignees
Labels
bug Only issues that describe bugs. difficulty:low Solving this is likely not that difficult documentation good first issue priority:urgent Should be addressed ASAP UX / UI Everything related to design and user experience

Comments

@Nereboss
Copy link
Collaborator

Bug

Expected Behavior

WHEN

Looking at the legend

THEN

The MCC is described with the correct words (likely McCabe Complexity or Cyclomatic Complexity)

Actual Behavior

The MCC is described as Maximum Cyclomatic Complexity

Specifications

  • is released in online-demo: yes
  • CodeCharta Version: 1.121.1
  • OS: Mac
  • Browser: Yes
@Nereboss Nereboss added bug Only issues that describe bugs. documentation UX / UI Everything related to design and user experience labels Dec 21, 2023
@ce-bo ce-bo added priority:high Set by PO difficulty:low Solving this is likely not that difficult good first issue labels Jan 12, 2024
@phanlezz
Copy link
Collaborator

phanlezz commented Jan 25, 2024

Some notes to cc, mcc
Detekt Analyse Definition (Sonar alternative) https://detekt.dev/docs/rules/complexity/

@phanlezz
Copy link
Collaborator

Two ideas:

  • CC : Cyclomatic complexity : Total number of paths through the code as defined by McCabe.
  • MCC: McCabe Cyclomatic complexity; Total number of paths through the code as defined by McCabe.

@ce-bo
Copy link
Collaborator

ce-bo commented Jan 30, 2024

The two mentioned metrics are the same, no?

I am used to also count && and || operators for a complexity metric.
According to the docs, Sonar is doing the same. I suggest to stick to this approach at least for metric gardener. I think the mcc in Codecharta is the same than the complexity metric of Sonar, or is it the "real" McCabe Complexity?

@phanlezz
Copy link
Collaborator

The two mentioned metrics are the same, no?

I am used to also count && and || operators for a complexity metric. According to the docs, Sonar is doing the same. I suggest to stick to this approach at least for metric gardener. I think the mcc in Codecharta is the same than the complexity metric of Sonar, or is it the "real" McCabe Complexity?

I thought (wrongly), that sonar uses MCC, but it is a modified version as you say.
As sonar is our primary source of complexity metrics, I would agree with your position and stick to the same definition.
That would be:
CC : Cyclomatic complexity : Total number of paths through the code.
Correct?

@ce-bo
Copy link
Collaborator

ce-bo commented Jan 30, 2024

Yes, I think that is fine. It is unfortune that the acronym is mcc. But in the sope of this issue I would keep it. An update would require some more changes and would also be a breaking change that we should communicate to the users.

I will create an issue for renaming mcc to e.g. sonar_complexity when it is imported or generated by sonar. For me it doesn't make sense to translate sonar imported metrics to a not understandable metric like mcc with a missing are deviating definition. It can coexist with the sonar_cognitive_complexity. Thus, there might be other complexity metrics that can be imported but would be named differently then.

I think there are a lot of hard references to mcc in the code. We must evaluate on how to get rid of those.

@ChristianHuehn ChristianHuehn added priority:urgent Should be addressed ASAP and removed priority:high Set by PO labels Apr 16, 2024
@Nereboss Nereboss self-assigned this Apr 16, 2024
@Nereboss
Copy link
Collaborator Author

Update/conclusion on the current situation for this issue:

Our mcc metric is the complexity metric from sonar but renamed.
Currently we define it as "Maximum cyclomatic complexity" where the Maximum does not make much sense and can easily be confused for "McCabe cyclomatic complexity".

The first idea was to not rename it anymore which would result in us having a 'new' sonar_complexity metric but no mcc metric anymore. As mcc is one of the most used metrics, this change should not be done before informing/discussing it with the stakeholders.

This issue will be blocked until we decide on how to continue with this problem

@Nereboss Nereboss added the blocked The issue or feature is blocked on another issue or PR that has to be resolved first label Apr 17, 2024
@ChristianHuehn
Copy link
Collaborator

Yes we can stop renaming it to mcc and use the default name instead. In that specific case: sonar_complexity

@ChristianHuehn ChristianHuehn removed the blocked The issue or feature is blocked on another issue or PR that has to be resolved first label Apr 22, 2024
@ChristianHuehn
Copy link
Collaborator

As proposed by @Nereboss we stop to rename it and add "(formerly MCC)" to it.
In like a month we will remove the suffix entirely.

Nereboss added a commit that referenced this issue Apr 30, 2024
@Nereboss Nereboss linked a pull request Apr 30, 2024 that will close this issue
6 tasks
Nereboss added a commit that referenced this issue Apr 30, 2024
phanlezz pushed a commit that referenced this issue May 6, 2024
Nereboss added a commit that referenced this issue May 6, 2024
phanlezz pushed a commit that referenced this issue May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Only issues that describe bugs. difficulty:low Solving this is likely not that difficult documentation good first issue priority:urgent Should be addressed ASAP UX / UI Everything related to design and user experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants