saif-deepsource / apkleaks

Errors detected in .deepsource.toml.

File opened without the with statement PTC-W0010
Anti-pattern
Critical
3 years ago3 years old
Use the with statement to open a file
108		return self.unique(found)
109
110	def extract(self, name, matches):
111		output = open(self.output, "a+")112		if matches:
113			stdout = ("[%s]" % (name))
114			self.writeln("\n" + stdout, clr.OKGREEN)
Use the with statement to open a file
 5import os
 6
 7def header():
 8	VERSION = open(os.path.dirname(os.path.realpath(__file__)) + "/VERSION", "r").read() 9	return ("     _    ____  _  ___               _        \n    / \\  |  _ \\| |/ / |    ___  __ _| | _____ \n   / _ \\ | |_) | ' /| |   / _ \\/ _` | |/ / __|\n  / ___ \\|  __/| . \\| |__|  __/ (_| |   <\\__ \\\n /_/   \\_\\_|   |_|\\_\\_____\\___|\\__,_|_|\\_\\___/\n {}\n --\n Scanning APK file for URIs, endpoints & secrets\n (c) 2020-2021, dwisiswant0\n".format(VERSION))
10
11def argument():