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

Response for a class (RFC) measure #496

Open
andrii-pukhalevych opened this issue Sep 13, 2023 · 2 comments
Open

Response for a class (RFC) measure #496

andrii-pukhalevych opened this issue Sep 13, 2023 · 2 comments

Comments

@andrii-pukhalevych
Copy link
Contributor

Feature request

Is it possible to add Response for a class (RFC) measure?

@andrii-pukhalevych
Copy link
Contributor Author

@niconoe- what is better visitor class to add RFC metric? I will do PR for it.

Response for a class (RFC) is a number of methods in class + number of unique method calls from another classes.

The metric called the response for a class (RFC) measures the number of different methods that can be executed when an object of that class receives a message (when a method is invoked for that object). Ideally, we would want to find for each method of the class, the methods that class will call, and repeat this for each called method, calculating what is called the transitive closure of the method's call graph. This process can however be both expensive and quite inaccurate. In ckjm, we calculate a rough approximation to the response set by simply inspecting method calls within the class's method bodies. The value of RFC is the sum of number of methods called within the class's method bodies and the number of class's methods. This simplification was also used in the 1994 Chidamber and Kemerer description of the metrics.

@niconoe-
Copy link
Contributor

niconoe- commented Sep 14, 2023

Well, it looks like a structural metric at class level, so I guess in Hal/Metric/Class_/Structural/ you could add a new visitor.

This metric should definitly be part of PhpMetrics, so thank you for including it 😉 .

Please start from the 3.x-dev branch as it shouldn't be part of master yet, and this metric should be availble in the next incoming version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants