Code Duplication    Length = 9-10 lines in 2 locations

spike/views/sandbox.py 1 location

@@ 119-128 (lines=10) @@
116
    scores = list()
117
    cpt = 0
118
    while "cscore{}".format(cpt) in nxdic:
119
        cscore = "cscore{}".format(cpt)
120
        score = "score{}".format(cpt)
121
        scores.append("that reached a <strong>{}</strong> score of <strong>{}</strong> ".format(
122
            nxdic[cscore], nxdic[score]))
123
        cpt += 1
124
    explain += ' and '.join(scores)
125
126
    cpt = 0
127
    named = list()
128
    while "id{}".format(cpt) in nxdic:
129
        _id = "id{}".format(cpt)
130
        _var_name = "var_name{}".format(cpt)
131
        _zone = "zone{}".format(cpt)

spike/views/whitelists.py 1 location

@@ 93-101 (lines=9) @@
90
            nxdic[key] = value[0]
91
92
        cpt = 0
93
        while "id{}".format(cpt) in nxdic:
94
            _id = "id{}".format(cpt)
95
            _var_name = "var_name{}".format(cpt)
96
            _zone = "zone{}".format(cpt)
97
            if "var_name{}".format(cpt) in nxdic:
98
                whitelist.append('BasicRule wl:{} "mz:{}:{}"'.format(nxdic[_id], nxdic[_var_name], nxdic[_zone]))
99
            else:
100
                whitelist.append('BasicRule wl:{} "mz:{}"'.format(nxdic[_id], nxdic[_var_name]))
101
            cpt += 1
102
    return render_template("misc/whitelist_generator.html", whitelist='\n'.join(whitelist) + ';', nxlogs=nxlogs)
103
104