Errors detected in .deepsource.toml
.
95 def finder(self, pattern, path):
96 matcher = re.compile(pattern)
97 found = []
98 for path, _, files in os.walk(path): 99 for fn in files:
100 filepath = os.path.join(path, fn)
101 if mimetypes.guess_type(filepath)[0] is None:
A local name is redefining an argument, which might suggest a potential error. This is taken into account only for a handful of name binding operations, such as for
iterations, with
statements, and exception handler assignments.
def print_files(filename):
with open(filename) as f:
files = f.readlines()
for filename in files: # `filename` is already defined outside!
print(filename)
def print_files(filename):
with open(filename) as f:
files = f.readlines()
for file in files: # renamed it to `file` to avoid conflict
print(file)