Open samuelsoder opened 2 years ago
The go method of the BellmanFord class
If = 3 || = 0 && = 2 While = 0 For = 7 Return = 1 (Void method, not printed at end)
M = 12 - 1 + 2 = 13
This function with high CC is 57 LOC which is fairly long. The Bellman Ford algorithm is an algorithm for finding the shortest path from a source vertex to each other vertex in the graph. The purpose of the method is to calculate that path and distance to each other vertex. The for-loops used in the algorithm is needed, and the high CC is therefore connected to the complexity of the algorithm.
Exceptions are not taken into account by this tool.
The documentation is ok. Some further explanation of different parts of the algorithm would help in understanding what is being calculated at each step.
Coverage prior to the implementation of new tests
Coverage efter the implementation of new test
The implementation of the Bellman-Ford algorithm with method go in
src/main/java/com/thealgorithms/datastructures/graphs/BellmanFord.java
has reported cyclomatic complexity 13 by lizard.Part 1 steps:
Part 2 steps:
issue<No>/manual-instrument
)issue<No>/increase-coverage
). Assignment PDF gives more detailed steps on what steps should be taken to identify types of tests to add etc.