Q: Complexity of a code is determined based on _________________.
-
A
Efferent Coupling
-
B
Number of source lines of code
-
C
Cyclomatic Complexity Number
-
D
Time taken to perform inspection
C
Answer:
C
Explanation:
✅ Cyclomatic Complexity Number
Explanation:
The complexity of code is primarily determined by Cyclomatic Complexity (CC), which measures the number of linearly independent paths in a program.
Why is it the correct answer?
- Cyclomatic Complexity Number ✅
- It calculates the control flow complexity of a program based on decision points (if, loops, switches).
- Higher complexity means harder to test and maintain code.
Why are the others incorrect?
- Efferent Coupling ❌
- Measures outgoing dependencies of a module, not code complexity.
- Number of Source Lines of Code (SLOC) ❌
- Measures code length but does not indicate logical complexity.
- Time taken to perform inspection ❌
- This depends on human effort and does not define complexity mathematically.
Thus, Cyclomatic Complexity Number is the correct answer! 🚀
Related Topic:
Share Above MCQ