-
Notifications
You must be signed in to change notification settings - Fork 81
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
Problem with CCM metric addition #522
Comments
@yegor256 i want to take that issue. Do you think implementing dfs inside xsl file is a good approach? |
@starkda you can try. Indeed, implementing all metrics in XSL is what this project is about. Only if it's absolutely impossible to do so, we resort to Java. |
@yegor256 now i am quite confident that using java is the only applicable approach. |
@starkda let's try! |
…rror while instrumenting java/sql/Date with JaCoCo 0.8.8.202204050719/5dcf34a)
The problem with CCM metrics was found in the file "org/jpeek/metrics/CCM.xsl" in line 65 the variable 'ncc' is assigned the number of methods connected by edges, but^ according to the definition NCC is the number of connectivity components in a graph.
Definition of graph component - https://en.wikipedia.org/wiki/Component_(graph_theory)
An example implementation of an algorithm for finding connectivity components in a graph - https://www.geeksforgeeks.org/connected-components-in-an-undirected-graph/
The class on which the metric works in error:
In the above example you can see that all 5 methods are one connectivity component, however, jpeek says that NCC = 5, so we can conclude that instead of connectivity components he counts the number of connected methods.
According to the definition of CCM, the class given as an example should get a score of 1 because:
Indeed, if we calculate the connectivity components of the graph from the example, then NCC = 1, substituting the correct value in the formula:
The CCM metric will be 1, this will be the correct answer.
The text was updated successfully, but these errors were encountered: