-
Notifications
You must be signed in to change notification settings - Fork 120
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
Nested classes issue #215
Comments
Thanks for the bug report @Mahdi-py. Indeed, this is due to the way the AST visitor is implemented. I'll take a look at a possible fix in the near future. |
I noticed the same issue whilst reading the code itself. Am I right assuming that adding Lines 310 to 314 in 44655c8
Alternatively change body_complexity += (
visitor.complexity
+ visitor.functions_complexity
+ len(visitor.functions)
) to body_complexity += (
visitor.total_complexity
+ len(visitor.functions)
) and change the |
That fix would allow Radon to count the complexity of all the code within the nested classes. That's the correct thing to do. However, it won't cause the nested classes to be shown in the reports. Since we do not report nested functions, I think that's also consistent with the rest of the code. I'll commit this fix after writing some test cases. |
the "radon cc {path}.py" does not detect any nested classes.
The above example is one of many. Do not bother about the logic of the code I am just experimenting something for other purposes. The program will not detect the nested classes nor the methods of that class.
The text was updated successfully, but these errors were encountered: