def METHOD_NAME(self, path):
    # overridden the bug in rflint which causes the tree to be traversed too many times
    self.count_files(path)
    for root, dirs, files in os.walk(path):
        for file in sorted(files):
            if self.__is_robot_file(file) and not self.__is_excluded_path(root, file):
                self._process_file(os.path.join(root, file))
        if self.args.recursive:
            # skip excluded directories
            dirs[:] = [dir for dir in dirs if not self.__is_excluded_path(root, dir)]
        else:
            # stop traversing
            del dirs[:]