Errors detected in .deepsource.toml
.
with
statements can be merged PTC-W0062With
statements` 33
34 def dependencies(self):
35 exter = "https://github.com/skylot/jadx/releases/download/v1.2.0/jadx-1.2.0.zip"
36 with closing(urlopen(exter)) as jadx: 37 with ZipFile(io.BytesIO(jadx.read())) as zfile:
38 zfile.extractall(self.main_dir + "/../jadx")
39 os.chmod(self.jadx, 33268)
Nested with
statements can be merged into a single compound with
statement.
This issue is raised only when there are no other statements between the nested with
statements.
Merging collapsible with
statements can decrease cognitive complexity, improving code readability.
with open("file1", "w") as file1:
with open("file2", "w") as file2:
doSomething()
with open("file1", "w") as file1, open("file2", "w") as file2:
doSomething()