Last analyzed 576285e 3 months ago
Default analysis branch is
Currently analyzing run
Unnecessary use of json.loads() for file data PY-W0078
Anti-pattern
5 months ago7 months old
json.loads(ses.read()) can be replaced with json.load(ses)
 8        self.rss_url = "https://www.repubblica.it/rss/esteri/rss2.0.xml"
 9        self.corriere_url = "http://xml2.corriereobjects.it/rss/esteri.xml"
10        ses = open("articles.json", "r")
11        self.articles = json.loads(ses.read())12        ses.close()
13        self.send_announcements.start()
14        self.send_announcements_corriere.start()
json.loads(session.read()) can be replaced with json.load(session)
56        print("a")
57        session = open("corriere.json ", "r")
58
59        cor_articles = json.loads(session.read())60        session.close()
61        print("corriere")
62        print(cor.title in cor_articles)
json.loads(f.read()) can be replaced with json.load(f)
 24    @commands.command()
 25    async def settings(self, ctx, key, value):
 26        f = open("settings.json", "r")
 27        jsonf = json.loads(f.read()) 28        f.close()
 29        jsonf[key] = value
 30        f = open("settings.json", "w")