potiuk commented on PR #53149: URL: https://github.com/apache/airflow/pull/53149#issuecomment-3092286119
> Cyclomatic complexity is defined by control flow/run time paths through code. Imports have no bearing on it Yes, when you focus on complexity of functions and individual modules you measure function calls/coniditionals/nesting. But in complex systems what is more important is cyclomatic complexity of independent modules using each other - simply cyclomatic complexity can be measured on multiple levels. If your program consists of independent modules, what replaces ifs/loops/nesting with those modules calling each other. and in "source code" level = calling a method is equivalent to making an import between the modules. Yoy don't measure how many times you call particular function, but you measure that you "call" the other module at all. Importing from another module it's practically the only way (barring dynamic programming) that you can "call" other module. And on the module level, that is the important bit. Practical manifestation of it is that it's lowest complexity when you are either being called or called. Also good (but worse) is when you both call and being called but you call "low level" modules that do not call other "high level" modules. And absolutely worst is when you have module A, calling module B, and module B calling module A (especially if done transitively through module C. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
