Wokia-Dev / EzFractal

Unused variable found PYL-W0612
Anti-pattern
Major
a year agoa year old
 21    with open(app_json_file, "r", encoding="utf-8") as file:
 22        data = json.load(file)
 23
 24    nb_buttons = len(data["EzFractalButtons"]) 25    for i, button in enumerate(data["EzFractalButtons"]):
 26        generate_image(button["c_real"], button["c_imag"], button["max_iterations"],
 27                       "popular_fractal_" + str(i) + ".png")
108            z = 0
109            num_iter = 0
110            # iterate the function until the number is diverging or the max iterations is reached
111            for i in range(max_iter):112                # julia set formula
113                z = z ** 2 + c
114                if z.real ** 2 + z.imag ** 2 > 4:
 71            num_iter = 0
 72
 73            # iterate the function until the number is diverging or the max iterations is reached
 74            for i in range(max_iter): 75                # julia set formula
 76                z = z ** 2 + c
 77                if z.real ** 2 + z.imag ** 2 > 4:
Unused variable 'nb_buttons'
 21    with open(app_json_file, "r", encoding="utf-8") as file:
 22        data = json.load(file)
 23
 24    nb_buttons = len(data["EzFractalButtons"]) 25    for i, button in enumerate(data["EzFractalButtons"]):
 26        generate_image(button["c_real"], button["c_imag"], button["max_iterations"],
 27                       "popular_fractal_" + str(i) + ".png")
Unused variable 'i'
108            z = 0
109            num_iter = 0
110            # iterate the function until the number is diverging or the max iterations is reached
111            for i in range(max_iter):112                # julia set formula
113                z = z ** 2 + c
114                if z.real ** 2 + z.imag ** 2 > 4: