source.cleaner.cleaner()   A
last analyzed

Complexity

Conditions 5

Size

Total Lines 12
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 12
nop 1
dl 0
loc 12
rs 9.3333
c 0
b 0
f 0
1
def cleaner(source: str):
2
    lines = source.split('\n')
3
    for i in range(len(lines)):
4
        strings = lines[i].split()
5
        for string in strings:
6
            if string[0] == ';':
7
                index = strings.index(string)
8
                delete = strings[index:]
9
                for item in delete:
10
                    strings.remove(item)
11
        lines[i] = ' '.join(strings)
12
    return '\n'.join(lines)
13