def process(self, temp_path: str, real_path: str) -> Result: result = Result() path = real_path.replace(self.git_root, '') if path in self.changed_files: result.score = self.UNCOMMITTED_FILES_WEIGHTING result.rules = ['Git_Uncommitted_Changes'] else: result.score = self.COMMITTED_FILES_WEIGHTING return result
def process(self, temp_path: str, real_path: str) -> Result: result = Result() wp_path = real_path.replace(self.wp_root, '') if wp_path not in self.wp_checksums: return result elif self.wp_checksums[wp_path] != self.__get_file_checksum(real_path): result.rules.append('Hash_Verification_Failure') result.score = self.HASH_SCORE_WEIGHTING else: result.rules.append('Hash_Verification_Success') result.score = -self.HASH_SCORE_WEIGHTING return result