Code Duplication    Length = 11-11 lines in 3 locations

utils/move_rules.py 1 location

@@ 113-123 (lines=11) @@
110
    return new_contents
111
112
113
def add_key_subkey(contents, key, subkey, value):
114
    new_line = "    " + subkey + ": " + value
115
    key_range = find_section_lines(contents, key)[0]
116
117
    # Since there is always at least one line in the key_range (when [0] == [1]),
118
    # it is always safe to add the new value right after the key header.
119
    start_line = key_range[0] + 1
120
    new_contents = contents[0:start_line]
121
    new_contents.append(new_line)
122
    new_contents.extend(contents[start_line:])
123
    return new_contents
124
125
126
def get_key(line):

utils/duplicated_prodtypes.py 1 location

@@ 137-147 (lines=11) @@
134
    return new_contents
135
136
137
def add_key_subkey(contents, key, subkey, value):
138
    new_line = "    " + subkey + ": " + value
139
    key_range = find_section_lines(contents, key)[0]
140
141
    # Since there is always at least one line in the key_range (when [0] == [1]),
142
    # it is always safe to add the new value right after the key header.
143
    start_line = key_range[0] + 1
144
    new_contents = contents[0:start_line]
145
    new_contents.append(new_line)
146
    new_contents.extend(contents[start_line:])
147
    return new_contents
148
149
150
def get_key(line):

utils/fix_file_ocilclause.py 1 location

@@ 137-147 (lines=11) @@
134
    return new_contents
135
136
137
def add_key_subkey(contents, key, subkey, value):
138
    new_line = "    " + subkey + ": " + value
139
    key_range = find_section_lines(contents, key)[0]
140
141
    # Since there is always at least one line in the key_range (when [0] == [1]),
142
    # it is always safe to add the new value right after the key header.
143
    start_line = key_range[0] + 1
144
    new_contents = contents[0:start_line]
145
    new_contents.append(new_line)
146
    new_contents.extend(contents[start_line:])
147
    return new_contents
148
149
150
def get_key(line):