Fixed following SonarQube issues:

- Remove this assignment to the local variable, the value is never used.
  - Rename local variables to match the regular expression
  - Add logic to this except clause or eliminate it and rethrow the exception automatically.
  - Rename fields to match the regular expression
  - Extract this nested conditional expression into an independent statement.
  - Change this default value to "None" and initialize this parameter inside the function/method.
  - Update this function so that its implementation is not identical to __repr__
  - Refactor this method to not always return the same value
  - Reraise this exception to stop the application as the user expects
  - Add missing parameters _w _PY3. This method overrides simplejson.decoder.JSONDecoder.decode.
  - Remove this redundant continue.
  - Remove this unused function declaration
  - Remove this identity check; it will always be False.
This commit is contained in:
Aditya Toshniwal
2020-08-03 12:59:51 +05:30
committed by Akshay Joshi
parent eb2c554601
commit 536593bf8a
19 changed files with 74 additions and 113 deletions

View File

@@ -721,7 +721,7 @@ class DictWriter(object):
raise ValueError("extrasaction (%s) must be 'raise' or 'ignore'"
% self.extrasaction)
dialect = kwds.get('dialect', "excel")
self.Writer = Writer(f, dialect, *args, **kwds)
self.writer = Writer(f, dialect, *args, **kwds)
def writeheader(self):
header = dict(zip(self.fieldnames, self.fieldnames))
@@ -736,7 +736,7 @@ class DictWriter(object):
return (rowdict.get(key, self.restval) for key in self.fieldnames)
def writerow(self, rowdict):
return self.Writer.writerow(self._dict_to_list(rowdict))
return self.writer.writerow(self._dict_to_list(rowdict))
def writerows(self, rowdicts):
return self.Writer.writerows(map(self._dict_to_list, rowdicts))
return self.writer.writerows(map(self._dict_to_list, rowdicts))