OLGKAD / sef18group15-coverage

Algorithms and Data Structures implemented in Java
Apache License 2.0
0 stars 0 forks source link

compute CC of SplayTree<T::splay() and document the purpose of each branch (in comments) #3

Open OLGKAD opened 6 years ago

sareng commented 6 years ago

https://github.com/OLGKAD/sef18group15-coverage/blob/80bf99af73ab327465ed2ed10b9fdb5601ea5315/src/com/jwetherell/algorithms/data_structures/SplayTree.java#L61-L188

To calculate the CC of the function, I used M = pi - s + 2, where pi is decisions (if/else/for, including &&/||) and s is exit points (return/throw/end of function). The resultig CC I got from this is 25 (19 ifs with 7 &&/|| and 1 ternary, and 3 returns and 1 end of function, 27-4+2).