diff --git a/Makefile b/Makefile index f2cb82f..3d9ee30 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -UTIL_VERSION := 0.5.29 +UTIL_VERSION := 0.5.30 UTIL_NAME := codeplag PWD := $(shell pwd) diff --git a/src/codeplag/algorithms/featurebased.py b/src/codeplag/algorithms/featurebased.py index c26e858..0a6b949 100644 --- a/src/codeplag/algorithms/featurebased.py +++ b/src/codeplag/algorithms/featurebased.py @@ -94,7 +94,7 @@ def get_children_indexes( count_of_nodes (int): count of elements in the tree. Complexity: - O(len(tree)) + O(n) """ indexes = [] count_of_children = 0 @@ -118,9 +118,7 @@ def find_max_index(array: np.ndarray) -> np.ndarray: array (np.ndarray): matrix of compliance (np.ndarray object). Complexity: - rows = array.shape[0] - columns = array.shape[1] - O(rows * columns) + O(n^2) """ maximum = 0 diff --git a/src/codeplag/handlers/check.py b/src/codeplag/handlers/check.py index 80b4bb1..533b4eb 100644 --- a/src/codeplag/handlers/check.py +++ b/src/codeplag/handlers/check.py @@ -320,6 +320,15 @@ def _do_step( metrics = None if self.reporter is not None: metrics = self.reporter.get_result(work1, work2) + if isinstance(metrics, FullCompareInfo) and ( + metrics.first_heads != work1.head_nodes or metrics.second_heads != work2.head_nodes + ): + logger.warning( + "Invalid data for the '%s' and '%s' found in cache.", + work1.filepath, + work2.filepath, + ) + metrics = None if metrics is None: future = self._create_future_compare(executor, work1, work2) future.id = len(processing) # type: ignore