Code Duplication    Length = 15-15 lines in 2 locations

utils/move_rules.py 1 location

@@ 351-365 (lines=15) @@
348
        print("%d: %s" % (line_num, file_contents[line_num]))
349
350
351
def walk_dir(ssg_root, product, function):
352
    product_guide = os.path.join(ssg_root, product, 'guide')
353
    _pgl = len(product_guide)
354
355
    data = None
356
    for root, dirs, files in os.walk(product_guide):
357
        for filename in files:
358
            path = os.path.join(root, filename)
359
360
            obj_name = filename
361
            is_rule = len(path) >= 5 and path[-5:] == '.rule'
362
363
            if is_rule:
364
                obj_name = filename[:-5]
365
                function(ssg_root, product, path, obj_name)
366
367
368
def parse_args():

utils/fix_file_ocilclause.py 1 location

@@ 214-228 (lines=15) @@
211
        print("%d: %s" % (line_num, file_contents[line_num]))
212
213
214
def walk_dir(ssg_root, function):
215
    product_guide = os.path.join(ssg_root, 'linux_os', 'guide')
216
    _pgl = len(product_guide)
217
218
    data = None
219
    for root, dirs, files in os.walk(product_guide):
220
        for filename in files:
221
            path = os.path.join(root, filename)
222
223
            obj_name = filename
224
            is_rule = len(path) >= 5 and path[-5:] == '.rule'
225
226
            if is_rule:
227
                obj_name = filename[:-5]
228
                function(ssg_root, path, obj_name)
229
230
231
def parse_args():